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

From Thomas Lockhart
Subject Re: SET NULL / SET NOT NULL
Date
Msg-id 3C745E24.94B34DC5@fourpalms.org
Whole thread Raw
In response to Re: SET NULL / SET NOT NULL  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Responses Re: SET NULL / SET NOT NULL
List pgsql-hackers
(our mail crossed in the ether...)

> Let's say, theoretically, that in the future we want to allow people to
> change the type of their columns, plus allow them to change the nullability.

Right.

> Should we come up with a syntax for changing nullability that allows for the
> future changing of column type?  If so, then a syntaxes like these might be
> the way to go:

Yup.

> If we just allow the full col spec we could one day support this:
> ALTER TABLE blah ALTER COLUMN col text boolean NOT NULL DEFAULT 'f';
> Which would change the column to that definition (if coercion is possible)
> no matter what current definition is...

Right. No point in *precluding* that with a short-sighted choice of
syntax.

> Is this the eventual goal?  Will this cause shift/reduce errors? will we
> need to put the word 'SET' in after 'col'?

Probably not, if we can already do this with CREATE TABLE.

And if we head this direction, then choosing a syntax which most closely
mimics the current CREATE TABLE will allow altering two columns at once,
which would be more efficient presumably than doing one column at a
time.
                   - Thomas


pgsql-hackers by date:

Previous
From: Sean Chittenden
Date:
Subject: Re: A Replication Idea
Next
From: Philip Warner
Date:
Subject: Re: SET NULL / SET NOT NULL