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

From Zeugswetter Andreas SB SD
Subject Re: SET NULL / SET NOT NULL
Date
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA4961D93@m0114.s-mxs.net
Whole thread Raw
In response to SET NULL / SET NOT NULL  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Responses Re: SET NULL / SET NOT NULL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> > Do we want the above syntax, or this syntax:
> >
> > ALTER TABLE blah ALTER COLUMN col SET NOT NULL;
> > ALTER TABLE blah ALTER COLUMN col SET NULL;
>
> My only objection to the second command is that it's plain wrong.  You
> don't set anything to NULL, so don't make the command look like it.

Imho it would be nice if the command would look exactly like a create
table. It is simply convenient to use cut and paste :-) And I haven't
seen a keyword yet, that would make it more descriptive, certainly not SET.

ALTER TABLE blah ALTER [COLUMN] col [int4] [NOT NULL] [DEFAULT 32];
ALTER TABLE blah ALTER [COLUMN] col [int8] [NULL] [DEFAULT 32];
maybe even [DEFAULT NULL] to drop the default :-)

Andreas



pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: notification: pg_notify ?
Next
From: Thomas Lockhart
Date:
Subject: pg_control contents