Index: src/backend/executor/execMain.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/executor/execMain.c,v retrieving revision 1.241.4.2 diff -c -r1.241.4.2 execMain.c *** src/backend/executor/execMain.c 12 Jan 2006 21:49:17 -0000 1.241.4.2 --- src/backend/executor/execMain.c 24 Mar 2006 18:05:53 -0000 *************** *** 36,41 **** --- 36,42 ---- #include "catalog/heap.h" #include "catalog/namespace.h" #include "commands/tablecmds.h" + #include "commands/tablespace.h" #include "commands/trigger.h" #include "executor/execdebug.h" #include "executor/execdefs.h" *************** *** 731,736 **** --- 732,738 ---- { char *intoName; Oid namespaceId; + Oid tablespaceId; AclResult aclresult; Oid intoRelationId; TupleDesc tupdesc; *************** *** 747,752 **** --- 749,764 ---- aclcheck_error(aclresult, ACL_KIND_NAMESPACE, 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 */ *************** *** 754,760 **** intoRelationId = heap_create_with_catalog(intoName, namespaceId, ! InvalidOid, tupdesc, RELKIND_RELATION, false, --- 766,772 ---- intoRelationId = heap_create_with_catalog(intoName, namespaceId, ! tablespaceId, tupdesc, RELKIND_RELATION, false,