/* ---------------- *NamespaceCreate * *Createanamespace(schema)withthegivennameandownerOID. * *IfisTempistrue,thisschemaisaper-backendschemaforholding *temporarytables.Currently,itisusedtopreventitfrombeing *linkedasamemberofanyactiveextension.(IfsomeonedoesCREATE *TEMPTABLEinanextensionscript,wedon'twantthetempschemato *becomepartoftheextension).AndtoavoidcheckingfordefaultACL *fortempnamespace(asitisnotnecessary). *---------------
*/
Oid
NamespaceCreate(constchar *nspName, Oid ownerId, bool isTemp)
{
Relation nspdesc;
HeapTuple tup;
Oid nspoid; bool nulls[Natts_pg_namespace];
Datum values[Natts_pg_namespace];
NameData nname;
TupleDesc tupDesc;
ObjectAddress myself; int i;
Acl *nspacl;
/* 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)));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.