From: majid@apsalar.com
To: pgsql-bugs@postgresql.org
Subject: BUG #9555: pg_dump for tables with inheritance recreates the table with the wrong order of columns
Date: Thu, 13 Mar 2014 04:39:00 +0000
Message-ID: <20140313043900.398.17129@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 9555
Logged by: Fazal Majid
Email address: majid@apsalar.com
PostgreSQL version: 9.2.6
Operating system: OpenIndiana b151 Solaris x64
Description:
Reproduction case:
create table A(a int, b int, c int);
create table B(a int, c int);
alter table A inherit B;
pg_dump (whether in default or -Fc mode) generates:
CREATE TABLE a (
a integer,
b integer,
c integer
)
INHERITS (b);
and after pg_restore, the order of columns is inverted, as if the table
were:
CREATE TABLE a (
a integer,
c integer,
b intege,
)
This causes things like unqualified INSERT INTO statements to start failing
(bad practice, I know).
The solution would be to generate CREATE TABLE followed by ALTER TABLE
INHERIT rather than CREATE TABLE ... INHERITS.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: majid@apsalar.com
Subject: Re: BUG #9555: pg_dump for tables with inheritance recreates the table with the wrong order of columns
In-Reply-To: <20140313043900.398.17129@wrigleys.postgresql.org>
References: <20140313043900.398.17129@wrigleys.postgresql.org>
* 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