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

From Christopher Kings-Lynne
Subject Re: SET NULL / SET NOT NULL
Date
Msg-id GNELIHDDFBOCMGBFGEFOCENHCBAA.chriskl@familyhealth.com.au
Whole thread Raw
In response to Re: SET NULL / SET NOT NULL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Seems one keyword shy of a load; I'd prefer
>
> ALTER TABLE blah ALTER COLUMN col SET TYPE int4;
>
> Otherwise, every keyword that might appear after SET will have to be
> fully reserved (else it couldn't be distinguished from a type name).

I like that...

So would you then envisage something like this:

ALTER TABLE blah ALTER COLUMN col SET TYPE int4 DEFAULT 3 NOT NULL;

or

ALTER TABLE blah ALTER COLUMN col SET DEFAULT 3 TYPE int4 NULL;

etc.

ie. Order wouldn't matter and you could do them all at once for convenience?
This seems like a cool idea to me.

Problem with all this, of course, is that it's different to everyone else's
syntax, but then they're all different to each other.  There's no standard
for it, but if there's a new standard - I wonder what they would specify?
Since altering a column is a not oft used operation, I would expect that the
punters wouldn't have a problem looking in the docs for how to do it, for
each different DBMS they use...

Chris



pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: Where to get official SQL spec (was Re: Domain Support)
Next
From: Peter Eisentraut
Date:
Subject: Re: Problem with reloading groups in pg_hba.conf