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

From Bruce Momjian
Subject Re: SET NULL / SET NOT NULL
Date
Msg-id 200203221920.g2MJK9N26123@candle.pha.pa.us
Whole thread Raw
In response to Re: SET NULL / SET NOT NULL  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: SET NULL / SET NOT NULL  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List pgsql-hackers
Tom Lane wrote:
> "Ross J. Reedstrom" <reedstrm@rice.edu> writes:
> > BTW, is NULLABLE so ugly that no one wanted to comment on it?
> 
> I kinda liked it, actually, if we were going to use the SET syntax.
> But people seem to be focused in on this "let's make it look like
> CREATE" notion.  I'm willing to wait and see how far that can be made
> to work.

OK, how about:
SET CONSTRAINT NOT NULL

or
DROP CONSTRAINT NOT NULL

or simply:
SET/DROP NOT NULL

I think the problem with trying to get it look like CREATE TABLE is that
the plain NULL parameter to CREATE TABLE is meaningless and probably
should never be used.  I remember at one point pg_dump output NULL in
the schema output and it confused many people. NOT NULL is the
constraint, and I think any solution to remove NOT NULL has to include
the NOT NULL keyword.  I think this is also why SET NULL looks so bad. 
"CREATE TABLE test (x int NULL)" doesn't look great either.  :-)  What
is that NULL doing there?

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Use of PG_BINARY_R and "r"
Next
From: Thomas Lockhart
Date:
Subject: Re: SET NULL / SET NOT NULL