From: Noah Misch <noah@leadboat.com>
To: Bruce Momjian <bruce@momjian.us>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: majid@apsalar.com
Cc: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Subject: Re: [BUGS] Re: BUG #9555: pg_dump for tables with inheritance recreates the table with the wrong order of columns
Date: Mon, 1 Sep 2014 18:24:34 -0400
Message-ID: <20140901222434.GA906981@tornado.leadboat.com> (raw)
In-Reply-To: <20140830233226.GC15078@momjian.us>
References: <20140313043900.398.17129@wrigleys.postgresql.org>
<20140313134739.GD4744@eldon.alvh.no-ip.org>
<15349.1394720340@sss.pgh.pa.us>
<20140314153304.GA6899@eldon.alvh.no-ip.org>
<20140317231212.GA3854149@tornado.leadboat.com>
<20140827144053.GL14956@momjian.us>
<31422.1409153093@sss.pgh.pa.us>
<20140828014030.GA777962@tornado.leadboat.com>
<20140830233226.GC15078@momjian.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On Sat, Aug 30, 2014 at 07:32:26PM -0400, Bruce Momjian wrote:
> On Wed, Aug 27, 2014 at 09:40:30PM -0400, Noah Misch wrote:
> > > > 3. use the pg_dump binary-upgrade code when such cases happen
> >
> > +1. We have the convention that, while --binary-upgrade can inject catalog
> > hacks, regular pg_dump uses standard, documented DDL. I like that convention
> > on general aesthetic grounds and for its benefit to non-superusers. Let's
> > introduce the DDL needed to fix this bug while preserving that convention,
> > namely DDL to toggle attislocal.
>
> I have spend some time researching this, and I am not sure what to
> recommend. The basic issue is that CREATE TABLE INHERITS always puts
> the inherited columns first, so to preserve column ordering, you have to
> use CREATE TABLE and then ALTER TABLE INHERIT. The problem there is
> that ALTER TABLE INHERIT doesn't preserve attislocal, and it also has
> problems with constraints not being marked local. I am just not sure we
> want to add SQL-level code to do that. Would it be documented?
Yes; I value the fact that ordinary pg_dump emits only documented SQL. In a
similar vein, we added ALTER TABLE OF for the benefit of pg_dump.
> I have developed the attached patch to warn about column reordering in
> this odd case. The patch mentions the reordering of c:
This, as amended downthread, seems useful.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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: noah@leadboat.com, bruce@momjian.us, tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, majid@apsalar.com, pgsql-hackers@postgreSQL.org
Subject: Re: [BUGS] Re: BUG #9555: pg_dump for tables with inheritance recreates the table with the wrong order of columns
In-Reply-To: <20140901222434.GA906981@tornado.leadboat.com>
References: <20140313043900.398.17129@wrigleys.postgresql.org> <20140313134739.GD4744@eldon.alvh.no-ip.org> <15349.1394720340@sss.pgh.pa.us> <20140314153304.GA6899@eldon.alvh.no-ip.org> <20140317231212.GA3854149@tornado.leadboat.com> <20140827144053.GL14956@momjian.us> <31422.1409153093@sss.pgh.pa.us> <20140828014030.GA777962@tornado.leadboat.com> <20140830233226.GC15078@momjian.us> <20140901222434.GA906981@tornado.leadboat.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