Re: BUG #1290: Default value and ALTER...TYPE

From: Troels Arvin <troels(at)arvin(dot)dk>
To: pgsql-bugs(at)postgresql(dot)org
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: BUG #1290: Default value and ALTER...TYPE
Date: 2004-10-20 18:29:12
Message-ID: pan.2004.10.20.18.29.11.985947@arvin.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Wed, 20 Oct 2004 14:07:29 -0400, Tom Lane wrote:

> Hmm. What's going on here is that the stored default expression is
> actually of the form
> ('TODO'::varchar)::varchar(2)

Would it be possible to check the compatibility of a default value for
the associated column? Such a check might probably have to be limited to
checking of scalar default values - not function calls - to make it
doable.
This would be nice anyway, to catch stupid CREATE TABLE errors earlier.

If such a compatibility check could somehow be implemented, then the check
could be applied for

- CREATE TABLE ...
- ALTER TABLE ... ALTER COLUMN ... SET DEFAULT...
- ALTER TABLE ... ALTER COLUMN ... TYPE...
- CREATE DOMAIN ...

--
Greetings from Troels Arvin, Copenhagen, Denmark

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2004-10-21 04:19:38 Re: [HACKERS] BUG #1290: Default value and ALTER...TYPE
Previous Message Rod Taylor 2004-10-20 18:17:49 Re: [HACKERS] BUG #1290: Default value and ALTER...TYPE

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2004-10-20 19:38:16 Re: tsearch2 windows make failure
Previous Message Rod Taylor 2004-10-20 18:17:49 Re: [HACKERS] BUG #1290: Default value and ALTER...TYPE