MCPcopy Create free account
hub / github.com/apache/cloudberry / CheckSetNamespace

Function CheckSetNamespace

src/backend/catalog/namespace.c:3043–3069  ·  view source on GitHub ↗

* Common checks on switching namespaces. * * We complain if either the old or new namespaces is a temporary schema * (or temporary toast schema), or if either the old or new namespaces is the * TOAST schema. */

Source from the content-addressed store, hash-verified

3041 * TOAST schema.
3042 */
3043void
3044CheckSetNamespace(Oid oldNspOid, Oid nspOid)
3045{
3046 /* disallow renaming into or out of temp schemas */
3047 if (isAnyTempNamespace(nspOid) || isAnyTempNamespace(oldNspOid))
3048 ereport(ERROR,
3049 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3050 errmsg("cannot move objects into or out of temporary schemas")));
3051
3052 /* same for TOAST schema */
3053 if (nspOid == PG_TOAST_NAMESPACE || oldNspOid == PG_TOAST_NAMESPACE)
3054 ereport(ERROR,
3055 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3056 errmsg("cannot move objects into or out of TOAST schema")));
3057
3058 /* same for AO SEGMENT schema */
3059 if (nspOid == PG_AOSEGMENT_NAMESPACE || oldNspOid == PG_AOSEGMENT_NAMESPACE)
3060 ereport(ERROR,
3061 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3062 errmsg("cannot move objects into or out of AO SEGMENT schema")));
3063
3064 /* same for EXT AUX schema */
3065 if (nspOid == PG_EXTAUX_NAMESPACE || oldNspOid == PG_EXTAUX_NAMESPACE)
3066 ereport(ERROR,
3067 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3068 errmsg("cannot move objects into or out of namespace pg_ext_aux")));
3069}
3070
3071/*
3072 * QualifiedNameGetCreationNamespace

Callers 3

AlterTableNamespaceFunction · 0.85

Calls 3

isAnyTempNamespaceFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50

Tested by

no test coverage detected