Re: SET NULL / SET NOT NULL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Zeugswetter Andreas SB SD" <ZeugswetterA(at)spardat(dot)at>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>, "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SET NULL / SET NOT NULL
Date: 2002-03-22 18:12:09
Message-ID: 2488.1016820729@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Zeugswetter Andreas SB SD" <ZeugswetterA(at)spardat(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2002-03-22 18:17:52 Re: Again, sorry, caching, (Tom What do you think: function
Previous Message Igor Kovalenko 2002-03-22 17:46:03 Re: Fw: Fw: bad performance on irix