Re: BUG #5555: ALTER TABLE ONLY ... SET NOT NULL on parent prevent prior inherited tables from being restored

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Michael Glaesemann" <grzm(at)seespotcode(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5555: ALTER TABLE ONLY ... SET NOT NULL on parent prevent prior inherited tables from being restored
Date: 2010-07-12 18:39:19
Message-ID: 23109.1278959959@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Michael Glaesemann" <grzm(at)seespotcode(dot)net> writes:
> If you add a column to a parent table with no NOT NULL constraint and then
> add the NOT NULL constraint on the parent using ALTER TABLE ONLY (so only
> future tables inheriting from the parent have the constraint), the dump file
> does not indicate that those children created prior to the ALTER TABLE ONLY
> have no NOT NULL constraint.

Yeah. Past discussions of this have leaned to the viewpoint that we
should disallow the above, ie it should not be possible to have NOT NULL
on the parent unless all the children have it too. Nobody's got round
to implementing it though. There's a TODO item for it: see
"Move NOT NULL constraint information to pg_constraint"

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2010-07-12 20:21:04 Re: Bad localization in psql (french version) for Windows
Previous Message Antonio Rivas Valle 2010-07-12 17:08:33 Bad localization in psql (french version) for Windows