Re: NOT NULL Fixes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rod Taylor <rbt(at)rbt(dot)ca>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: NOT NULL Fixes
Date: 2003-01-02 19:33:31
Message-ID: 3008.1041536011@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Rod Taylor <rbt(at)rbt(dot)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

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Serguei Mokhov 2003-01-02 20:04:12 Re: pg_dump.options.diff
Previous Message Tom Lane 2003-01-02 18:58:27 Re: pg_dump.options.diff