Re: NOT NULL Fixes - Mailing list pgsql-patches

From Tom Lane
Subject Re: NOT NULL Fixes
Date
Msg-id 3008.1041536011@sss.pgh.pa.us
Whole thread Raw
In response to NOT NULL Fixes  (Rod Taylor <rbt@rbt.ca>)
List pgsql-patches
Rod Taylor <rbt@rbt.ca> writes:
> Enforces NOT NULL constraints to be applied against new PRIMARY KEY
> columns in DefineIndex.  So, ALTER TABLE ... PRIMARY KEY will now
> automatically add the NOT NULL constraint.  It appeared the alter_table
> regression test wanted this to occur, as after the change the regression
> test better matched in inline 'fails'/'succeeds' comments.

Committed with a few editorializations.

> The NOT NULL clause will NOT cascade to children at the moment.  Perhaps
> this should be the other way around?

I left that as-is, but I'm dubious about it too.  Ordinarily you'd
expect a NOT NULL constraint on a parent table to propagate to children
as well.  OTOH, since the PRIMARY KEY constraint itself doesn't
propagate to children, arguably it's more consistent to act this way
(at least until we tackle cross-table indexes).

It's a one-liner code change if we want it to act the other way, so I
figure we can put the main fix in now and argue about this detail later.

            regards, tom lane

pgsql-patches by date:

Previous
From: "Serguei Mokhov"
Date:
Subject: ru: translation updates -- backend and libpq
Next
From: "Serguei Mokhov"
Date:
Subject: Re: [HACKERS] pg_dump.options.diff