mirror of
https://github.com/postgres/postgres.git
synced 2025-08-24 09:27:52 +03:00
CREATE TABLE foo (x,y,z) AS SELECT ... can't apply target column names
to the target list in gram.y; it must wait till after expansion of the target list in analyze.c. Per bug report 4-Nov: lx=# CREATE TABLE abc (a char, b char, c char); CREATE lx=# CREATE TABLE xyz (x, y, z) AS SELECT * FROM abc; ERROR: CREATE TABLE/AS SELECT has mismatched column count
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.159 2001/10/25 05:49:30 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.160 2001/11/05 05:00:14 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1835,6 +1835,7 @@ _copySelectStmt(SelectStmt *from)
|
||||
if (from->into)
|
||||
newnode->into = pstrdup(from->into);
|
||||
newnode->istemp = from->istemp;
|
||||
Node_Copy(from, newnode, intoColNames);
|
||||
Node_Copy(from, newnode, targetList);
|
||||
Node_Copy(from, newnode, fromClause);
|
||||
Node_Copy(from, newnode, whereClause);
|
||||
|
@@ -20,7 +20,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.107 2001/10/25 05:49:30 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.108 2001/11/05 05:00:14 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -681,6 +681,8 @@ _equalSelectStmt(SelectStmt *a, SelectStmt *b)
|
||||
return false;
|
||||
if (a->istemp != b->istemp)
|
||||
return false;
|
||||
if (!equal(a->intoColNames, b->intoColNames))
|
||||
return false;
|
||||
if (!equal(a->targetList, b->targetList))
|
||||
return false;
|
||||
if (!equal(a->fromClause, b->fromClause))
|
||||
|
Reference in New Issue
Block a user