Re: ALTER TABLE...ALTER COLUMN vs inheritance

Alex Hunsaker <badalex@gmail.com>

From: Alex Hunsaker <badalex@gmail.com>
To: Bernd Helmle <mailings@oopsware.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@postgresql.org
Date: 2009-11-16T18:00:33Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Catalog NOT NULL constraints

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 ]