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

From: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Neil Conway <neilc(at)samurai(dot)com>, 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 15:10:37
Message-ID: Pine.LNX.4.44.0410241707190.2015-100000@zigo.dhs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Sun, 24 Oct 2004, Tom Lane wrote:

> > (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.

Yes, and he suggested to not perform step 3. Instead one need to do that
when the default value is used.

--
/Dennis Björklund

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Neil Conway 2004-10-24 23:41:37 Re: [HACKERS] BUG #1290: Default value and ALTER...TYPE
Previous Message Tom Lane 2004-10-24 14:30:09 Re: [HACKERS] BUG #1290: Default value and ALTER...TYPE

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2004-10-24 16:39:40 Re: Proposed TODO: CREATE .... WITH OWNER;
Previous Message Tom Lane 2004-10-24 14:46:59 Re: Daylight saving time