From: Tom Lane <tgl@sss.pgh.pa.us>
To: majid@apsalar.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #9555: pg_dump for tables with inheritance recreates the table with the wrong order of columns
Date: Thu, 13 Mar 2014 09:47:37 -0400
Message-ID: <14563.1394718457@sss.pgh.pa.us> (raw)
In-Reply-To: <20140313043900.398.17129@wrigleys.postgresql.org>
References: <20140313043900.398.17129@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
majid@apsalar.com writes:
> 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 [ A with a,c,b ]
This is not a bug, but expected and desired behavior. The parent's column
order is considered canonical, and child tables are made to append their
columns to that. Perhaps in your use-case that's not how you'd like to
think about it, but if we were to change this we'd doubtless break things
for other people.
Possibly you could use pg_upgrade, which I believe does preserve physical
column order in such cases.
regards, tom lane
--
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: tgl@sss.pgh.pa.us, 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: <14563.1394718457@sss.pgh.pa.us>
References: <20140313043900.398.17129@wrigleys.postgresql.org> <14563.1394718457@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