On Mon, Sep  1, 2014 at 04:06:58PM -0400, Tom Lane wrote:
> Bruce Momjian <br...@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  <br...@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
new file mode 100644
index 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);
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to