Re: ALTER TABLE...ALTER COLUMN vs inheritance - Mailing list pgsql-hackers

From Alex Hunsaker
Subject Re: ALTER TABLE...ALTER COLUMN vs inheritance
Date
Msg-id 34d269d40911161000g46bfa76v7ce8b857b8db3b90@mail.gmail.com
Whole thread Raw
In response to Re: ALTER TABLE...ALTER COLUMN vs inheritance  (Bernd Helmle <mailings@oopsware.de>)
Responses Re: ALTER TABLE...ALTER COLUMN vs inheritance
Re: ALTER TABLE...ALTER COLUMN vs inheritance
List pgsql-hackers
On Thu, Nov 12, 2009 at 11:56, Bernd Helmle <mailings@oopsware.de> wrote:
> I've just started looking into this and wonder how this should look like.

IIRC another motivation for moving them into pg_constraint was we
could then give them names as required by the spec (unless I got mixed
up with defaults).  Looking at the 2003 spec I don't see any grammar
for that, so either I cant find it (likely) or its not there.  Either
way I see something like the below options:

ALTER TABLE ALTER COLUMN ADD CONSTRAINT my_not_null NOT NULL;
[ we dont currently support add constraint on ALTER COLUMN AFAICT...
but it might be nice? ]
-or-
ALTER TABLE ADD CONSTRAINT my_not_null NOT NULL (column);
-or-
ALTER TABLE ALTER COLUMN column SET NOT NULL 'name';

Comments?

Anyway Bernd if you are working on this great!  If not lemme know, Ill
plan on having something for the next commit feast.  Though I still
may never get around to it :(.

FYI defaults have the same problem.   Would it be awkward would it be
to use pg_constraint for the book keeping as well? [ and by that I
really mean ALTER TABLE ADD CONSTRAINT my_default DEFAULT .... so you
can give them a name ]


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ORDER BY vs. volatile functions
Next
From: Chris Browne
Date:
Subject: Re: next CommitFest