From: Tom Lane <tgl@sss.pgh.pa.us>
To: depstein@alliedtesting.com
Cc: pgsql-bugs@postgresql.org
Cc: pgagarinov@alliedtesting.com
Subject: Re: pg_dump doesn't save altered column information for inherited columns
Date: Tue, 01 Feb 2011 11:07:52 -0500
Message-ID: <27042.1296576472@sss.pgh.pa.us> (raw)
In-Reply-To: <29F36C7C98AB09499B1A209D48EAA615B501DA89D3@mail2a.alliedtesting.com>
References: <29F36C7C98AB09499B1A209D48EAA615B501DA89D3@mail2a.alliedtesting.com>
<depstein@alliedtesting.com> writes:
> I noticed that when pg_dump saves SQL code for a table with inheritance, it does not save any information about inherited columns. This is fine when inherited columns do not undergo any modification, but when they do, that information is lost.
> Example:
> create table parent (id integer not null);
> create table child (value integer) inherits (parent);
> alter table child alter column id drop not null;
Actually, the bug here is that ALTER TABLE lets you do that. Dropping
an inherited constraint should be disallowed, and is disallowed for the
case of CHECK constraints. We haven't gotten around to enhancing the
NOT NULL infrastructure to detect that, but it's on the TODO list.
In the meantime, there's no point in modifying pg_dump to worry about
such cases.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, depstein@alliedtesting.com, pgagarinov@alliedtesting.com
Subject: Re: pg_dump doesn't save altered column information for inherited columns
In-Reply-To: <27042.1296576472@sss.pgh.pa.us>
References: <29F36C7C98AB09499B1A209D48EAA615B501DA89D3@mail2a.alliedtesting.com> <27042.1296576472@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox