Index: src/backend/executor/execMain.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/executor/execMain.c,v retrieving revision 1.256.2.5 diff -c -r1.256.2.5 execMain.c *** src/backend/executor/execMain.c 12 Jan 2006 21:49:06 -0000 1.256.2.5 --- src/backend/executor/execMain.c 24 Mar 2006 17:57:11 -0000 *************** *** 37,42 **** --- 37,43 ---- #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" *************** *** 737,742 **** --- 738,744 ---- { char *intoName; Oid namespaceId; + Oid tablespaceId; AclResult aclresult; Oid intoRelationId; TupleDesc tupdesc; *************** *** 753,758 **** --- 755,770 ---- 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 */ *************** *** 760,766 **** intoRelationId = heap_create_with_catalog(intoName, namespaceId, ! InvalidOid, InvalidOid, GetUserId(), tupdesc, --- 772,778 ---- intoRelationId = heap_create_with_catalog(intoName, namespaceId, ! tablespaceId, InvalidOid, GetUserId(), tupdesc,