Re: [HACKERS] Quick Help

2002-12-06 Thread Tom Lane
"Christopher Kings-Lynne" <[EMAIL PROTECTED]> writes: > Messing about with ADD COLUMN... > I'm not certain how to re-evaluate the default expression for each > row? Basically you'll want to apply ExecEvalExpr (or perhaps ExecEvalExprSwitchContext) to the "cooked" expression tree. Look at the exec

Re: [HACKERS] Quick Help

2002-12-05 Thread Rod Taylor
It works very similarly to the way that ALTER TABLE ... ADD CHECK .. works, with the tuple update added in. Anyway, it's something like the below: - Lock relation - Pull out tuple - Evaluate cooked default expression using EvalExpr - heap_modifytuple (shove datum that EvalExpr returns into column

[HACKERS] Quick Help

2002-12-05 Thread Christopher Kings-Lynne
Hi guys, Messing about with ADD COLUMN... I'm not certain how to re-evaluate the default expression for each row? How do I do this? I have access to raw_default and cooked_default it seems. Thanks, Chris ---(end of broadcast)--- TIP 4: Don't '