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

From Thomas Lockhart
Subject Re: SET NULL / SET NOT NULL
Date
Msg-id 3C745C9E.E5B2C40@fourpalms.org
Whole thread Raw
In response to Re: SET NULL / SET NOT NULL  (Philip Warner <pjw@rhyme.com.au>)
Responses Re: SET NULL / SET NOT NULL
List pgsql-hackers
> >  ALTER TABLE blah ALTER COLUMN col [ALLOW NULL | NOT NULL]
> FWIW, I like this syntax too.

What would be the drawbacks to having all portions after "col" in the
example above be *exactly* the same as the clauses allowed in CREATE
TABLE? So, this would be
 ALTER TABLE tab ALTER COLUMN col [ NULL | NOT NULL ]

The syntax would then be entirely predictable if you knew what you would
have written if you had set the constraint during table creation. I'll
agree (if someone points it out) that this particular example is pretty
terse.

In that same line of thought, how about making it more closely mimic the
original CREATE TABLE syntax? Something like
 ALTER TABLE t (c1 NULL)

Hmm. Or if we are going to eventually allow altering column types then
one could include the type also. That may be a bit much, but having an
idea of what *that* syntax might be could help on manipulating other
column attributes too...
                   - Thomas


pgsql-hackers by date:

Previous
From: "Christopher Kings-Lynne"
Date:
Subject: Re: SET NULL / SET NOT NULL
Next
From: Sean Chittenden
Date:
Subject: Re: A Replication Idea