|
|
|
@ -26,7 +26,7 @@ |
|
|
|
* |
|
|
|
* |
|
|
|
* |
|
|
|
* |
|
|
|
* IDENTIFICATION |
|
|
|
* IDENTIFICATION |
|
|
|
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.256.2.5 2006/01/12 21:49:06 tgl Exp $ |
|
|
|
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.256.2.6 2006/04/26 23:01:58 momjian Exp $ |
|
|
|
* |
|
|
|
* |
|
|
|
*------------------------------------------------------------------------- |
|
|
|
*------------------------------------------------------------------------- |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ -37,6 +37,7 @@ |
|
|
|
#include "catalog/heap.h" |
|
|
|
#include "catalog/heap.h" |
|
|
|
#include "catalog/namespace.h" |
|
|
|
#include "catalog/namespace.h" |
|
|
|
#include "commands/tablecmds.h" |
|
|
|
#include "commands/tablecmds.h" |
|
|
|
|
|
|
|
#include "commands/tablespace.h" |
|
|
|
#include "commands/trigger.h" |
|
|
|
#include "commands/trigger.h" |
|
|
|
#include "executor/execdebug.h" |
|
|
|
#include "executor/execdebug.h" |
|
|
|
#include "executor/execdefs.h" |
|
|
|
#include "executor/execdefs.h" |
|
|
|
@ -737,6 +738,7 @@ InitPlan(QueryDesc *queryDesc, bool explainOnly) |
|
|
|
{ |
|
|
|
{ |
|
|
|
char *intoName; |
|
|
|
char *intoName; |
|
|
|
Oid namespaceId; |
|
|
|
Oid namespaceId; |
|
|
|
|
|
|
|
Oid tablespaceId; |
|
|
|
AclResult aclresult; |
|
|
|
AclResult aclresult; |
|
|
|
Oid intoRelationId; |
|
|
|
Oid intoRelationId; |
|
|
|
TupleDesc tupdesc; |
|
|
|
TupleDesc tupdesc; |
|
|
|
@ -753,6 +755,16 @@ InitPlan(QueryDesc *queryDesc, bool explainOnly) |
|
|
|
aclcheck_error(aclresult, ACL_KIND_NAMESPACE, |
|
|
|
aclcheck_error(aclresult, ACL_KIND_NAMESPACE, |
|
|
|
get_namespace_name(namespaceId)); |
|
|
|
get_namespace_name(namespaceId)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tablespaceId = GetDefaultTablespace(); |
|
|
|
|
|
|
|
if (OidIsValid(tablespaceId)) { |
|
|
|
|
|
|
|
aclresult = pg_tablespace_aclcheck(tablespaceId, GetUserId(), |
|
|
|
|
|
|
|
ACL_CREATE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (aclresult != ACLCHECK_OK) |
|
|
|
|
|
|
|
aclcheck_error(aclresult, ACL_KIND_TABLESPACE, |
|
|
|
|
|
|
|
get_tablespace_name(tablespaceId)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* have to copy tupType to get rid of constraints |
|
|
|
* have to copy tupType to get rid of constraints |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ -760,7 +772,7 @@ InitPlan(QueryDesc *queryDesc, bool explainOnly) |
|
|
|
|
|
|
|
|
|
|
|
intoRelationId = heap_create_with_catalog(intoName, |
|
|
|
intoRelationId = heap_create_with_catalog(intoName, |
|
|
|
namespaceId, |
|
|
|
namespaceId, |
|
|
|
InvalidOid, |
|
|
|
tablespaceId, |
|
|
|
InvalidOid, |
|
|
|
InvalidOid, |
|
|
|
GetUserId(), |
|
|
|
GetUserId(), |
|
|
|
tupdesc, |
|
|
|
tupdesc, |
|
|
|
|