Re: SET NULL / SET NOT NULL

From: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
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 12:51:02
Message-ID: 20020322125103.C883B1D72@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On March 22, 2002 01:31 am, Peter Eisentraut wrote:
> Christopher Kings-Lynne writes:
> > 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.

How about this?

ALTER TABLE blah ALTER COLUMN col UNSET NOT NULL;

I would almost think that it should be NOTNULL anyway to make it clear that we
are setting (or unsetting) one thing and that it is not a weird way of saying
"...NOT SET NULL" or "NOT UNSET NULL" but I realize that it should also look
more like the NOT NULL clause we already have in the CREATE TABLE query.

--
D'Arcy J.M. Cain <darcy(at){druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2002-03-22 13:11:25 Re: notification: pg_notify ?
Previous Message Luis Alberto Amigo Navarro 2002-03-22 08:19:35 Re: Problem compiling PostgreSQL 7.2 on IRIX 6.5.15f