From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David G Johnston <david.g.johnston@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: 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 16:40:11 -0400
Message-ID: <20140901204011.GD19338@momjian.us> (raw)
In-Reply-To: <16088.1409602018@sss.pgh.pa.us>
References: <20140827144053.GL14956@momjian.us>
<31422.1409153093@sss.pgh.pa.us>
<20140828014030.GA777962@tornado.leadboat.com>
<20140830233226.GC15078@momjian.us>
<4268.1409503835@sss.pgh.pa.us>
<1409507164344-5817073.post@n5.nabble.com>
<14363.1409508633@sss.pgh.pa.us>
<20140901200040.GC19338@momjian.us>
<16088.1409602018@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On Mon, Sep 1, 2014 at 04:06:58PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > NOTICE: moving and merging column "c" with inherited definition
> > DETAIL: user-specified column moved to the location of the inherited
> > column
>
> Dept of nitpicking: errdetail messages are supposed to be complete
> sentences, properly capitalized and punctuated. Please re-read the
> style guidelines if you have forgotten them.
Oh, yeah; updated patch attached.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ Everyone has their own god. +
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackersAttachments:inh-warning.diff (text/x-diff, 1.9K) downloaddiff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.cnew file mode 100644index 3720a0f..ece6b0f
*** a/src/backend/commands/tablecmds.c
--- b/src/backend/commands/tablecmds.c
*************** MergeAttributes(List *schema, List *supe
*** 1756,1767 ****
--- 1756,1771 ----
*/
if (inhSchema != NIL)
{
+ int schema_attno = 0;+
foreach(entry, schema)
{
ColumnDef *newdef = lfirst(entry);
char *attributeName = newdef->colname;
int exist_attno;
+ schema_attno++;+
/*
* Does it conflict with some previously inherited column?
*/
*************** MergeAttributes(List *schema, List *supe
*** 1780,1788 ****
* Yes, try to merge the two column definitions. They must
* have the same type, typmod, and collation.
*/
! ereport(NOTICE,
! (errmsg("merging column \"%s\" with inherited definition",
! attributeName)));
def = (ColumnDef *) list_nth(inhSchema, exist_attno - 1);
typenameTypeIdAndMod(NULL, def->typeName, &defTypeId, &deftypmod);
typenameTypeIdAndMod(NULL, newdef->typeName, &newTypeId, &newtypmod);
--- 1784,1797 ----
* Yes, try to merge the two column definitions. They must
* have the same type, typmod, and collation.
*/
! if (exist_attno == schema_attno)
! ereport(NOTICE,
! (errmsg("merging column \"%s\" with inherited definition",
! attributeName)));
! else
! ereport(NOTICE,
! (errmsg("moving and merging column \"%s\" with inherited definition", attributeName),
! errdetail("User-specified column moved to the location of the inherited column.")));
def = (ColumnDef *) list_nth(inhSchema, exist_attno - 1);
typenameTypeIdAndMod(NULL, def->typeName, &defTypeId, &deftypmod);
typenameTypeIdAndMod(NULL, newdef->typeName, &newTypeId, &newtypmod);
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: bruce@momjian.us, tgl@sss.pgh.pa.us, david.g.johnston@gmail.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: <20140901204011.GD19338@momjian.us>
References: <20140827144053.GL14956@momjian.us> <31422.1409153093@sss.pgh.pa.us> <20140828014030.GA777962@tornado.leadboat.com> <20140830233226.GC15078@momjian.us> <4268.1409503835@sss.pgh.pa.us> <1409507164344-5817073.post@n5.nabble.com> <14363.1409508633@sss.pgh.pa.us> <20140901200040.GC19338@momjian.us> <16088.1409602018@sss.pgh.pa.us> <20140901204011.GD19338@momjian.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