mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Add TABLESPACE and ON COMMIT clauses to CREATE TABLE AS. ON COMMIT is
required by the SQL standard, and TABLESPACE is useful functionality. Patch from Kris Jurka, minor editorialization by Neil Conway.
This commit is contained in:
@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.326 2006/02/04 19:06:46 adunstan Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.327 2006/02/19 00:04:26 neilc Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1662,6 +1662,8 @@ _copyQuery(Query *from)
|
||||
COPY_SCALAR_FIELD(resultRelation);
|
||||
COPY_NODE_FIELD(into);
|
||||
COPY_SCALAR_FIELD(intoHasOids);
|
||||
COPY_SCALAR_FIELD(intoOnCommit);
|
||||
COPY_STRING_FIELD(intoTableSpaceName);
|
||||
COPY_SCALAR_FIELD(hasAggs);
|
||||
COPY_SCALAR_FIELD(hasSubLinks);
|
||||
COPY_NODE_FIELD(rtable);
|
||||
@ -1729,6 +1731,8 @@ _copySelectStmt(SelectStmt *from)
|
||||
COPY_NODE_FIELD(into);
|
||||
COPY_NODE_FIELD(intoColNames);
|
||||
COPY_SCALAR_FIELD(intoHasOids);
|
||||
COPY_SCALAR_FIELD(intoOnCommit);
|
||||
COPY_STRING_FIELD(intoTableSpaceName);
|
||||
COPY_NODE_FIELD(targetList);
|
||||
COPY_NODE_FIELD(fromClause);
|
||||
COPY_NODE_FIELD(whereClause);
|
||||
@ -2631,6 +2635,10 @@ _copyExecuteStmt(ExecuteStmt *from)
|
||||
|
||||
COPY_STRING_FIELD(name);
|
||||
COPY_NODE_FIELD(into);
|
||||
COPY_SCALAR_FIELD(into_contains_oids);
|
||||
COPY_SCALAR_FIELD(into_has_oids);
|
||||
COPY_SCALAR_FIELD(into_on_commit);
|
||||
COPY_STRING_FIELD(into_tbl_space);
|
||||
COPY_NODE_FIELD(params);
|
||||
|
||||
return newnode;
|
||||
|
@ -18,7 +18,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.262 2006/02/04 19:06:46 adunstan Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.263 2006/02/19 00:04:26 neilc Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -673,6 +673,8 @@ _equalQuery(Query *a, Query *b)
|
||||
COMPARE_SCALAR_FIELD(resultRelation);
|
||||
COMPARE_NODE_FIELD(into);
|
||||
COMPARE_SCALAR_FIELD(intoHasOids);
|
||||
COMPARE_SCALAR_FIELD(intoOnCommit);
|
||||
COMPARE_STRING_FIELD(intoTableSpaceName);
|
||||
COMPARE_SCALAR_FIELD(hasAggs);
|
||||
COMPARE_SCALAR_FIELD(hasSubLinks);
|
||||
COMPARE_NODE_FIELD(rtable);
|
||||
@ -732,6 +734,8 @@ _equalSelectStmt(SelectStmt *a, SelectStmt *b)
|
||||
COMPARE_NODE_FIELD(into);
|
||||
COMPARE_NODE_FIELD(intoColNames);
|
||||
COMPARE_SCALAR_FIELD(intoHasOids);
|
||||
COMPARE_SCALAR_FIELD(intoOnCommit);
|
||||
COMPARE_STRING_FIELD(intoTableSpaceName);
|
||||
COMPARE_NODE_FIELD(targetList);
|
||||
COMPARE_NODE_FIELD(fromClause);
|
||||
COMPARE_NODE_FIELD(whereClause);
|
||||
@ -1493,6 +1497,10 @@ _equalExecuteStmt(ExecuteStmt *a, ExecuteStmt *b)
|
||||
{
|
||||
COMPARE_STRING_FIELD(name);
|
||||
COMPARE_NODE_FIELD(into);
|
||||
COMPARE_SCALAR_FIELD(into_contains_oids);
|
||||
COMPARE_SCALAR_FIELD(into_has_oids);
|
||||
COMPARE_SCALAR_FIELD(into_on_commit);
|
||||
COMPARE_STRING_FIELD(into_tbl_space);
|
||||
COMPARE_NODE_FIELD(params);
|
||||
|
||||
return true;
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.267 2006/01/31 21:39:23 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.268 2006/02/19 00:04:26 neilc Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Every node type that can appear in stored rules' parsetrees *must*
|
||||
@ -1374,6 +1374,8 @@ _outSelectStmt(StringInfo str, SelectStmt *node)
|
||||
WRITE_NODE_FIELD(into);
|
||||
WRITE_NODE_FIELD(intoColNames);
|
||||
WRITE_ENUM_FIELD(intoHasOids, ContainsOids);
|
||||
WRITE_ENUM_FIELD(intoOnCommit, OnCommitAction);
|
||||
WRITE_STRING_FIELD(intoTableSpaceName);
|
||||
WRITE_NODE_FIELD(targetList);
|
||||
WRITE_NODE_FIELD(fromClause);
|
||||
WRITE_NODE_FIELD(whereClause);
|
||||
@ -1504,6 +1506,9 @@ _outQuery(StringInfo str, Query *node)
|
||||
|
||||
WRITE_INT_FIELD(resultRelation);
|
||||
WRITE_NODE_FIELD(into);
|
||||
WRITE_BOOL_FIELD(intoHasOids);
|
||||
WRITE_ENUM_FIELD(intoOnCommit, OnCommitAction);
|
||||
WRITE_STRING_FIELD(intoTableSpaceName);
|
||||
WRITE_BOOL_FIELD(hasAggs);
|
||||
WRITE_BOOL_FIELD(hasSubLinks);
|
||||
WRITE_NODE_FIELD(rtable);
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.183 2005/12/28 01:29:59 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.184 2006/02/19 00:04:26 neilc Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Path and Plan nodes do not have any readfuncs support, because we
|
||||
@ -140,6 +140,9 @@ _readQuery(void)
|
||||
READ_NODE_FIELD(utilityStmt);
|
||||
READ_INT_FIELD(resultRelation);
|
||||
READ_NODE_FIELD(into);
|
||||
READ_BOOL_FIELD(intoHasOids);
|
||||
READ_ENUM_FIELD(intoOnCommit, OnCommitAction);
|
||||
READ_STRING_FIELD(intoTableSpaceName);
|
||||
READ_BOOL_FIELD(hasAggs);
|
||||
READ_BOOL_FIELD(hasSubLinks);
|
||||
READ_NODE_FIELD(rtable);
|
||||
|
Reference in New Issue
Block a user