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 assume that's the correct behaviour? If they specify a default, the
column should be auto-filled with that default, right?
If someone could give me a really quick example look on how to do this, it'd
be really appreciated and would save me heaps of time...
The trick is that the default clause needs to be actually evaluated, not
just set - eg. nextval('"my_seq"') sort of thing.
I guess the other tricky bit is checking that the default value satisfies
the check constraint...?
Chris