Help with ADD COLUMN

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Help with ADD COLUMN
Дата
Msg-id 01ac01c2934a$d14c59a0$6500a8c0@internal
обсуждение исходный текст
Ответы Re: Help with ADD COLUMN  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Help with ADD COLUMN  (Philip Warner <pjw@rhyme.com.au>)
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: regression failures
Следующее
От: Daniele Orlandi
Дата:
Сообщение: Re: Optimizer & boolean syntax