Re: SET NULL / SET NOT NULL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SET NULL / SET NOT NULL
Date
Msg-id 2488.1016820729@sss.pgh.pa.us
Whole thread Raw
In response to Re: SET NULL / SET NOT NULL  ("Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>)
Responses Re: SET NULL / SET NOT NULL  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
Re: SET NULL / SET NOT NULL  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at> writes:
> ALTER TABLE blah ALTER [COLUMN] col [int4] [NOT NULL] [DEFAULT 32];
> ALTER TABLE blah ALTER [COLUMN] col [int8] [NULL] [DEFAULT 32];

This cannot work unless you are prepared to turn a lot more keywords
into reserved words.  In the CREATE syntax, the data type is not
optional.  In the above, there will be parse conflicts because the
system won't be able to decide whether a type name is present or not.

You could possibly make it work if you were willing to include the word
TYPE when trying to respecify column type:

ALTER TABLE blah ALTER [COLUMN] col [TYPE int4] [NOT NULL] [DEFAULT 32];

Also I agree with Fernando that trying to make the word COLUMN optional
is likely to lead to conflicts.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Igor Kovalenko
Date:
Subject: Re: Fw: Fw: bad performance on irix
Next
From: Jan Wieck
Date:
Subject: Re: Again, sorry, caching, (Tom What do you think: function