Re: [BUGS] BUG #1290: Default value and ALTER...TYPE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] BUG #1290: Default value and ALTER...TYPE
Дата
Msg-id 8379.1098628209@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [BUGS] BUG #1290: Default value and ALTER...TYPE  (Neil Conway <neilc@samurai.com>)
Ответы Re: [BUGS] BUG #1290: Default value and ALTER...TYPE  (Dennis Bjorklund <db@zigo.dhs.org>)
Re: [BUGS] BUG #1290: Default value and ALTER...TYPE  (Neil Conway <neilc@samurai.com>)
Список pgsql-hackers
Neil Conway <neilc@samurai.com> writes:
> Tom Lane wrote:
>> Possibly we should make ALTER COLUMN strip any implicit coercions that
>> appear at the top level of the default expression before it adds on the
>> implicit coercion to the new column datatype.

> That seems like a kludge. When processing a column default expression, we:

> (1) Accept the default's raw parsetree from the parser
> (2) Convert it to a cooked parsetree via transformExpr()
> (3) Add a coercion to the table's column type

> Can't we save the cooked parsetree that we produced in #2?

Not without an initdb (to have another column to put it in).  And it
would produce exactly the same result anyway, because the only way there
could be implicit coercion steps at the top of the expression is because
step 3 put them there.
        regards, tom lane


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

Предыдущее
От: Dennis Bjorklund
Дата:
Сообщение: Re: [BUGS] BUG #1290: Default value and ALTER...TYPE
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Daylight saving time