mirror of
https://github.com/postgres/postgres.git
synced 2025-10-22 14:32:25 +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);
|
||||
|
Reference in New Issue
Block a user