From: depstein@alliedtesting.com
To: pgsql-bugs@postgresql.org
Cc: pgagarinov@alliedtesting.com
Subject: pg_dump doesn't save altered column information for inherited columns
Date: Tue, 1 Feb 2011 12:55:49 +0300
Message-ID: <29F36C7C98AB09499B1A209D48EAA615B501DA89D3@mail2a.alliedtesting.com> (raw)
Hello,
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;
insert into child values (null, 1);
Here is the code of the child table as generated by pg_dump:
CREATE TABLE child (
value integer
)
INHERITS (parent);
When the table is recreated using this code, the id column has the NOT NULL restriction, which was not present in the original.
I don't think this is right. Either inherited columns should be immune to changes, or else pg_dump should reflect those changes in its SQL code.
Dmitry
Dmitry Epstein | Developer
Allied Testing
T + 7 495 544 48 69 Ext 417
M + 7 926 215 73 36
www.alliedtesting.com<http://www.alliedtesting.com/;
We Deliver Quality.
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: depstein@alliedtesting.com, pgagarinov@alliedtesting.com
Subject: Re: pg_dump doesn't save altered column information for inherited columns
In-Reply-To: <29F36C7C98AB09499B1A209D48EAA615B501DA89D3@mail2a.alliedtesting.com>
References: <29F36C7C98AB09499B1A209D48EAA615B501DA89D3@mail2a.alliedtesting.com>
* 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