Re: [BUGS] BUG #1290: Default value and ALTER...TYPE - Mailing list pgsql-hackers

From Dennis Bjorklund
Subject Re: [BUGS] BUG #1290: Default value and ALTER...TYPE
Date
Msg-id Pine.LNX.4.44.0410241707190.2015-100000@zigo.dhs.org
Whole thread Raw
In response to Re: [BUGS] BUG #1290: Default value and ALTER...TYPE  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Daylight saving time
Next
From: Josh Berkus
Date:
Subject: Re: Proposed TODO: CREATE .... WITH OWNER;