PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "access/table.h"
#include "access/xact.h"
#include "catalog/catalog.h"
#include "catalog/dependency.h"
#include "catalog/indexing.h"
#include "catalog/namespace.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_authid.h"
#include "catalog/pg_namespace.h"
#include "commands/dbcommands.h"
#include "commands/event_trigger.h"
#include "commands/schemacmds.h"
#include "miscadmin.h"
#include "parser/parse_utilcmd.h"
#include "tcop/utility.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/rel.h"
#include "utils/syscache.h"
Go to the source code of this file.
Functions | |
static void | AlterSchemaOwner_internal (HeapTuple tup, Relation rel, Oid newOwnerId) |
Oid | CreateSchemaCommand (CreateSchemaStmt *stmt, const char *queryString, int stmt_location, int stmt_len) |
ObjectAddress | RenameSchema (const char *oldname, const char *newname) |
void | AlterSchemaOwner_oid (Oid oid, Oid newOwnerId) |
ObjectAddress | AlterSchemaOwner (const char *name, Oid newOwnerId) |
ObjectAddress AlterSchemaOwner | ( | const char * | name, |
Oid | newOwnerId | ||
) |
Definition at line 299 of file schemacmds.c.
References AlterSchemaOwner_internal(), CStringGetDatum, ereport, errcode(), errmsg(), ERROR, GETSTRUCT, HeapTupleIsValid, NAMESPACENAME, ObjectAddressSet, ReleaseSysCache(), RowExclusiveLock, SearchSysCache1(), table_close(), and table_open().
Referenced by ExecAlterOwnerStmt().
Definition at line 330 of file schemacmds.c.
References ACL_CREATE, aclcheck_error(), ACLCHECK_NOT_OWNER, ACLCHECK_OK, aclnewowner(), Assert, CatalogTupleUpdate(), changeDependencyOnOwner(), check_is_member_of_role(), DatumGetAclP, get_database_name(), GETSTRUCT, GetUserId(), heap_freetuple(), heap_modify_tuple(), InvokeObjectPostAlterHook, MyDatabaseId, NAMESPACENAME, NameStr, OBJECT_DATABASE, OBJECT_SCHEMA, ObjectIdGetDatum, pg_database_aclcheck(), pg_namespace_ownercheck(), PointerGetDatum, RelationGetDescr, RelationGetRelid, SysCacheGetAttr(), HeapTupleData::t_self, and HeapTupleData::t_tableOid.
Referenced by AlterSchemaOwner(), and AlterSchemaOwner_oid().
Definition at line 276 of file schemacmds.c.
References AlterSchemaOwner_internal(), elog, ERROR, HeapTupleIsValid, NAMESPACEOID, ObjectIdGetDatum, ReleaseSysCache(), RowExclusiveLock, SearchSysCache1(), table_close(), and table_open().
Referenced by shdepReassignOwned().
Oid CreateSchemaCommand | ( | CreateSchemaStmt * | stmt, |
const char * | queryString, | ||
int | stmt_location, | ||
int | stmt_len | ||
) |
Definition at line 50 of file schemacmds.c.
References ACL_CREATE, aclcheck_error(), ACLCHECK_OK, allowSystemTableMods, AUTHOID, CreateSchemaStmt::authrole, PlannedStmt::canSetTag, check_is_member_of_role(), CMD_UTILITY, CommandCounterIncrement(), PlannedStmt::commandType, CurrentMemoryContext, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, EventTriggerCollectSimpleCommand(), get_database_name(), get_rolespec_oid(), GetOverrideSearchPath(), GETSTRUCT, GetUserIdAndSecContext(), HeapTupleIsValid, CreateSchemaStmt::if_not_exists, InvalidObjectAddress, InvalidOid, IsReservedName(), lcons_oid(), lfirst, makeNode, MyDatabaseId, NamespaceCreate(), NAMESPACENAME, NameStr, None_Receiver, NOTICE, OBJECT_DATABASE, ObjectAddressSet, ObjectIdGetDatum, pg_database_aclcheck(), PointerGetDatum, PopOverrideSearchPath(), PROCESS_UTILITY_SUBCOMMAND, ProcessUtility(), pstrdup(), PushOverrideSearchPath(), ReleaseSysCache(), rolname, CreateSchemaStmt::schemaname, OverrideSearchPath::schemas, SearchSysCache1(), SearchSysCacheExists1, SECURITY_LOCAL_USERID_CHANGE, SetUserIdAndSecContext(), prepared_statement::stmt, PlannedStmt::stmt_len, PlannedStmt::stmt_location, transformCreateSchemaStmt(), and PlannedStmt::utilityStmt.
Referenced by CreateExtensionInternal(), and ProcessUtilitySlow().
ObjectAddress RenameSchema | ( | const char * | oldname, |
const char * | newname | ||
) |
Definition at line 218 of file schemacmds.c.
References ACL_CREATE, aclcheck_error(), ACLCHECK_NOT_OWNER, ACLCHECK_OK, allowSystemTableMods, CatalogTupleUpdate(), CStringGetDatum, ereport, errcode(), errdetail(), errmsg(), ERROR, get_database_name(), get_namespace_oid(), GETSTRUCT, GetUserId(), heap_freetuple(), HeapTupleIsValid, InvokeObjectPostAlterHook, IsReservedName(), MyDatabaseId, NAMESPACENAME, namestrcpy(), NoLock, OBJECT_DATABASE, OBJECT_SCHEMA, ObjectAddressSet, OidIsValid, pg_database_aclcheck(), pg_namespace_ownercheck(), RowExclusiveLock, SearchSysCacheCopy1, HeapTupleData::t_self, table_close(), and table_open().
Referenced by ExecRenameStmt().