Commit ef679ff6 authored by Tom Lane's avatar Tom Lane

Clean up a couple of bizarre code formatting choices in recent CREATE LIKE patch.

parent 82121aff
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/backend/parser/parse_utilcmd.c,v 2.29 2009/11/05 23:24:24 tgl Exp $ * $PostgreSQL: pgsql/src/backend/parser/parse_utilcmd.c,v 2.30 2009/11/13 23:49:23 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -647,7 +647,8 @@ transformInhRelation(ParseState *pstate, CreateStmtContext *cxt, ...@@ -647,7 +647,8 @@ transformInhRelation(ParseState *pstate, CreateStmtContext *cxt,
/* Likewise, copy comment if requested */ /* Likewise, copy comment if requested */
if ((inhRelation->options & CREATE_TABLE_LIKE_COMMENTS) && if ((inhRelation->options & CREATE_TABLE_LIKE_COMMENTS) &&
(comment = GetComment(attribute->attrelid, RelationRelationId, (comment = GetComment(attribute->attrelid,
RelationRelationId,
attribute->attnum)) != NULL) attribute->attnum)) != NULL)
{ {
CommentStmt *stmt = makeNode(CommentStmt); CommentStmt *stmt = makeNode(CommentStmt);
...@@ -667,7 +668,8 @@ transformInhRelation(ParseState *pstate, CreateStmtContext *cxt, ...@@ -667,7 +668,8 @@ transformInhRelation(ParseState *pstate, CreateStmtContext *cxt,
* Copy CHECK constraints if requested, being careful to adjust attribute * Copy CHECK constraints if requested, being careful to adjust attribute
* numbers * numbers
*/ */
if ((inhRelation->options & CREATE_TABLE_LIKE_CONSTRAINTS) && tupleDesc->constr) if ((inhRelation->options & CREATE_TABLE_LIKE_CONSTRAINTS) &&
tupleDesc->constr)
{ {
AttrNumber *attmap = varattnos_map_schema(tupleDesc, cxt->columns); AttrNumber *attmap = varattnos_map_schema(tupleDesc, cxt->columns);
int ccnum; int ccnum;
...@@ -690,8 +692,10 @@ transformInhRelation(ParseState *pstate, CreateStmtContext *cxt, ...@@ -690,8 +692,10 @@ transformInhRelation(ParseState *pstate, CreateStmtContext *cxt,
/* Copy comment on constraint */ /* Copy comment on constraint */
if ((inhRelation->options & CREATE_TABLE_LIKE_COMMENTS) && if ((inhRelation->options & CREATE_TABLE_LIKE_COMMENTS) &&
(comment = GetComment(GetConstraintByName(RelationGetRelid( (comment = GetComment(GetConstraintByName(RelationGetRelid(relation),
relation), n->conname), ConstraintRelationId, 0)) != NULL) n->conname),
ConstraintRelationId,
0)) != NULL)
{ {
CommentStmt *stmt = makeNode(CommentStmt); CommentStmt *stmt = makeNode(CommentStmt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment