aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-10-11 20:03:11 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-10-11 20:03:11 +0000
commit97fc0f6e831392b2701d34f700d028c436b96fab (patch)
tree849f45e73264be7db6e4ccab853caf7ffff62dfe /src
parent34cd09fdd0e871a08096b4d6535b6b66e694d81e (diff)
downloadpostgresql-97fc0f6e831392b2701d34f700d028c436b96fab.tar.gz
postgresql-97fc0f6e831392b2701d34f700d028c436b96fab.zip
CREATE TABLE ... LIKE ... should mark the columns it creates with
attislocal = true, since they are not really inherited but merely copied from the original table. I'm not sure if there are any cases where it makes a real difference given the existing uses of the flag, but wrong is wrong. This was fixed in passing in HEAD by the LIKE INCLUDING CONSTRAINTS patch, but never back-patched.
Diffstat (limited to 'src')
-rw-r--r--src/backend/parser/analyze.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index 52515630bef..f88f173b59b 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.326.2.2 2006/06/21 18:30:19 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.326.2.3 2006/10/11 20:03:11 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1088,7 +1088,7 @@ transformInhRelation(ParseState *pstate, CreateStmtContext *cxt,
constr = tupleDesc->constr;
/*
- * Insert the inherited attributes into the cxt for the new table
+ * Insert the copied attributes into the cxt for the new table
* definition.
*/
for (parent_attno = 1; parent_attno <= tupleDesc->natts;
@@ -1106,7 +1106,7 @@ transformInhRelation(ParseState *pstate, CreateStmtContext *cxt,
continue;
/*
- * Create a new inherited column.
+ * Create a new column, which is marked as NOT inherited.
*
* For constraints, ONLY the NOT NULL constraint is inherited by the
* new column definition per SQL99.
@@ -1118,7 +1118,7 @@ transformInhRelation(ParseState *pstate, CreateStmtContext *cxt,
typename->typmod = attribute->atttypmod;
def->typename = typename;
def->inhcount = 0;
- def->is_local = false;
+ def->is_local = true;
def->is_not_null = attribute->attnotnull;
def->raw_default = NULL;
def->cooked_default = NULL;