Re: SET NULL / SET NOT NULL

From: "Zeugswetter Andreas SB SD" <ZeugswetterA(at)spardat(dot)at>
To: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
Cc: "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SET NULL / SET NOT NULL
Date: 2002-03-22 14:42:16
Message-ID: 46C15C39FEB2C44BA555E356FBCD6FA4961D93@m0114.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2002-03-22 15:24:47 pg_control contents
Previous Message Hannu Krosing 2002-03-22 13:11:25 Re: notification: pg_notify ?