Re: pg_dump doesn't save altered column information for inherited columns

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: depstein(at)alliedtesting(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org, pgagarinov(at)alliedtesting(dot)com
Subject: Re: pg_dump doesn't save altered column information for inherited columns
Date: 2011-02-01 16:07:52
Message-ID: 27042.1296576472@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

<depstein(at)alliedtesting(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Steve White 2011-02-01 16:44:22 Re: Feature request: include script file into function body
Previous Message Tom Lane 2011-02-01 16:02:25 Re: Feature request: include script file into function body