#include "catalog/genbki.h"
Go to the source code of this file.
Defines | |
#define | NamespaceRelationId 2615 |
#define | Natts_pg_namespace 3 |
#define | Anum_pg_namespace_nspname 1 |
#define | Anum_pg_namespace_nspowner 2 |
#define | Anum_pg_namespace_nspacl 3 |
#define | PG_CATALOG_NAMESPACE 11 |
#define | PG_TOAST_NAMESPACE 99 |
#define | PG_PUBLIC_NAMESPACE 2200 |
Typedefs | |
typedef FormData_pg_namespace * | Form_pg_namespace |
Functions | |
CATALOG (pg_namespace, 2615) | |
DATA (insert OID=11("pg_catalog"PGUID _null_)) | |
DESCR ("system catalog schema") | |
DESCR ("reserved schema for TOAST tables") | |
DESCR ("standard public schema") | |
Oid | NamespaceCreate (const char *nspName, Oid ownerId, bool isTemp) |
Variables | |
FormData_pg_namespace |
#define Anum_pg_namespace_nspacl 3 |
Definition at line 61 of file pg_namespace.h.
Referenced by AlterSchemaOwner_internal(), ExecGrant_Namespace(), NamespaceCreate(), and pg_namespace_aclmask().
#define Anum_pg_namespace_nspname 1 |
Definition at line 59 of file pg_namespace.h.
Referenced by NamespaceCreate().
#define Anum_pg_namespace_nspowner 2 |
Definition at line 60 of file pg_namespace.h.
Referenced by AlterSchemaOwner_internal(), and NamespaceCreate().
#define NamespaceRelationId 2615 |
Definition at line 34 of file pg_namespace.h.
Referenced by AlterExtensionNamespace(), AlterObjectNamespace_internal(), AlterRelationNamespaceInternal(), AlterSchemaOwner(), AlterSchemaOwner_internal(), AlterSchemaOwner_oid(), AlterTypeNamespaceInternal(), EventTriggerSQLDropAddObject(), exec_object_restorecon(), ExecAlterExtensionContentsStmt(), ExecGrant_Namespace(), getObjectClass(), NamespaceCreate(), RangeVarGetAndCheckCreationNamespace(), RemoveRoleFromObjectACL(), RemoveSchemaById(), RenameSchema(), sepgsql_object_access(), sepgsql_object_relabel(), sepgsql_proc_post_create(), sepgsql_relation_post_create(), sepgsql_restorecon(), sepgsql_schema_post_create(), and shdepReassignOwned().
#define Natts_pg_namespace 3 |
Definition at line 58 of file pg_namespace.h.
#define PG_CATALOG_NAMESPACE 11 |
Definition at line 71 of file pg_namespace.h.
Referenced by analyze_rel(), CollationIsVisible(), ConversionIsVisible(), CreateProceduralLanguage(), deparseFuncExpr(), deparseOperatorName(), FunctionIsVisible(), GetOverrideSearchPath(), InitializeSearchPath(), OpclassIsVisible(), OperatorIsVisible(), OpfamilyIsVisible(), PushOverrideSearchPath(), recomputeNamespacePath(), RelationIsVisible(), TSConfigIsVisible(), TSDictionaryIsVisible(), TSParserIsVisible(), TSTemplateIsVisible(), TypeIsVisible(), and vacuum_rel().
#define PG_PUBLIC_NAMESPACE 2200 |
Definition at line 77 of file pg_namespace.h.
#define PG_TOAST_NAMESPACE 99 |
Definition at line 74 of file pg_namespace.h.
Referenced by CheckSetNamespace(), IsToastNamespace(), sepgsql_relation_drop(), and sepgsql_relation_post_create().
typedef FormData_pg_namespace* Form_pg_namespace |
Definition at line 51 of file pg_namespace.h.
CATALOG | ( | pg_namespace | , | |
2615 | ||||
) |
Definition at line 36 of file pg_namespace.h.
{ NameData nspname; Oid nspowner; #ifdef CATALOG_VARLEN /* variable-length fields start here */ aclitem nspacl[1]; #endif } FormData_pg_namespace;
DATA | ( | insert | OID = 11("pg_catalog"PGUID _null_) |
) |
DESCR | ( | "standard public schema" | ) |
DESCR | ( | "reserved schema for TOAST tables" | ) |
DESCR | ( | "system catalog schema" | ) |
Definition at line 41 of file pg_namespace.c.
References Anum_pg_namespace_nspacl, Anum_pg_namespace_nspname, Anum_pg_namespace_nspowner, Assert, CatalogUpdateIndexes(), ObjectAddress::classId, elog, ereport, errcode(), errmsg(), ERROR, heap_close, heap_form_tuple(), heap_open(), i, InvokeObjectPostCreateHook, NameGetDatum, NAMESPACENAME, NamespaceRelationId, namestrcpy(), NULL, ObjectAddress::objectId, ObjectIdGetDatum, ObjectAddress::objectSubId, OidIsValid, PointerGetDatum, RelationData::rd_att, recordDependencyOnCurrentExtension(), recordDependencyOnOwner(), RowExclusiveLock, SearchSysCacheExists1, simple_heap_insert(), and values.
Referenced by CreateSchemaCommand(), and InitTempTableNamespace().
{ Relation nspdesc; HeapTuple tup; Oid nspoid; bool nulls[Natts_pg_namespace]; Datum values[Natts_pg_namespace]; NameData nname; TupleDesc tupDesc; ObjectAddress myself; int i; /* sanity checks */ if (!nspName) elog(ERROR, "no namespace name supplied"); /* make sure there is no existing namespace of same name */ if (SearchSysCacheExists1(NAMESPACENAME, PointerGetDatum(nspName))) ereport(ERROR, (errcode(ERRCODE_DUPLICATE_SCHEMA), errmsg("schema \"%s\" already exists", nspName))); /* initialize nulls and values */ for (i = 0; i < Natts_pg_namespace; i++) { nulls[i] = false; values[i] = (Datum) NULL; } namestrcpy(&nname, nspName); values[Anum_pg_namespace_nspname - 1] = NameGetDatum(&nname); values[Anum_pg_namespace_nspowner - 1] = ObjectIdGetDatum(ownerId); nulls[Anum_pg_namespace_nspacl - 1] = true; nspdesc = heap_open(NamespaceRelationId, RowExclusiveLock); tupDesc = nspdesc->rd_att; tup = heap_form_tuple(tupDesc, values, nulls); nspoid = simple_heap_insert(nspdesc, tup); Assert(OidIsValid(nspoid)); CatalogUpdateIndexes(nspdesc, tup); heap_close(nspdesc, RowExclusiveLock); /* Record dependencies */ myself.classId = NamespaceRelationId; myself.objectId = nspoid; myself.objectSubId = 0; /* dependency on owner */ recordDependencyOnOwner(NamespaceRelationId, nspoid, ownerId); /* dependency on extension ... but not for magic temp schemas */ if (!isTemp) recordDependencyOnCurrentExtension(&myself, false); /* Post creation hook for new schema */ InvokeObjectPostCreateHook(NamespaceRelationId, nspoid, 0); return nspoid; }
Definition at line 44 of file pg_namespace.h.