Re: [HACKERS] Help with ADD COLUMN

2002-11-24 Thread Tom Lane
"Christopher Kings-Lynne" <[EMAIL PROTECTED]> writes: >> Basically you wanna do an "UPDATE tab SET col = ". I'd >> suggest letting the existing machinery handle as much of that as >> possible. > Using SPI calls? I wouldn't use SPI; it introduces way too many variables --- besides which, you alre

Re: [HACKERS] Help with ADD COLUMN

2002-11-24 Thread Christopher Kings-Lynne
> "Christopher Kings-Lynne" <[EMAIL PROTECTED]> writes: > > The one big programming difficulty I see is the process of running through > > all the existing tuples in the relation the column was added to and > > evaluating the default for each row. > > Basically you wanna do an "UPDATE tab SET col

Re: [HACKERS] Help with ADD COLUMN

2002-11-24 Thread Tom Lane
Philip Warner <[EMAIL PROTECTED]> writes: > At 03:48 PM 23/11/2002 -0800, Christopher Kings-Lynne wrote: >> I assume that's the correct behaviour? If they specify a default, the >> column should be auto-filled with that default, right? > Good question. No, it's perfectly clear in the spec:

Re: [HACKERS] Help with ADD COLUMN

2002-11-24 Thread Rod Taylor
On Sun, 2002-11-24 at 11:14, Hannu Krosing wrote: > On Sun, 2002-11-24 at 08:34, Philip Warner wrote: > > At 03:48 PM 23/11/2002 -0800, Christopher Kings-Lynne wrote: > > >I assume that's the correct behaviour? If they specify a default, the > > >column should be auto-filled with that default, rig

Re: [HACKERS] Help with ADD COLUMN

2002-11-24 Thread Hannu Krosing
On Sun, 2002-11-24 at 08:34, Philip Warner wrote: > At 03:48 PM 23/11/2002 -0800, Christopher Kings-Lynne wrote: > >I assume that's the correct behaviour? If they specify a default, the > >column should be auto-filled with that default, right? > > Good question. We might want some input from othe

Re: [HACKERS] Help with ADD COLUMN

2002-11-23 Thread Philip Warner
At 03:48 PM 23/11/2002 -0800, Christopher Kings-Lynne wrote: I assume that's the correct behaviour? If they specify a default, the column should be auto-filled with that default, right? Good question. We might want some input from other DBs; Dec RDB default existing rows to NULL irrespective o

Re: [HACKERS] Help with ADD COLUMN

2002-11-23 Thread Tom Lane
"Christopher Kings-Lynne" <[EMAIL PROTECTED]> writes: > The one big programming difficulty I see is the process of running through > all the existing tuples in the relation the column was added to and > evaluating the default for each row. Basically you wanna do an "UPDATE tab SET col = ". I'd su

[HACKERS] Help with ADD COLUMN

2002-11-23 Thread Christopher Kings-Lynne
Hi Guys, I'm starting work on ADD COLUMN. I'm going to allow: * SERIAL, SERIAL8 * DEFAULT * NOT NULL etc... The one big programming difficulty I see is the process of running through all the existing tuples in the relation the column was added to and evaluating the default for each row. I ass