Re: SET NULL / SET NOT NULL

From: Thomas Lockhart <lockhart(at)fourpalms(dot)org>
To: Doug McNaught <doug(at)wireboard(dot)com>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Philip Warner <pjw(at)rhyme(dot)com(dot)au>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SET NULL / SET NOT NULL
Date: 2002-02-21 02:34:06
Message-ID: 3C745C9E.E5B2C40@fourpalms.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sean Chittenden 2002-02-21 02:39:19 Re: A Replication Idea
Previous Message Christopher Kings-Lynne 2002-02-21 02:28:51 Re: SET NULL / SET NOT NULL