Skip site navigation (1) Skip section navigation (2)

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Troels Arvin <troels(at)arvin(dot)dk>, pgsql-bugs(at)postgresql(dot)org,pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] BUG #1290: Default value and ALTER...TYPE
Date: 2004-10-24 14:30:09
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugspgsql-hackers
Neil Conway <neilc(at)samurai(dot)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

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2004-10-24 14:39:35
Subject: Re: First set of OSDL Shared Mem scalability results, some
Previous:From: Dennis BjorklundDate: 2004-10-24 11:11:15
Subject: Re: [HACKERS] BUG #1290: Default value and ALTER...TYPE

pgsql-bugs by date

Next:From: Dennis BjorklundDate: 2004-10-24 15:10:37
Subject: Re: [HACKERS] BUG #1290: Default value and ALTER...TYPE
Previous:From: Jan WieckDate: 2004-10-24 14:15:00
Subject: Re: [Slony1-general] Thread-safety detection on HP-UX

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group