PostgreSQL Source Code  git master
extension.h File Reference
Include dependency graph for extension.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ObjectAddress CreateExtension (ParseState *pstate, CreateExtensionStmt *stmt)
 
void RemoveExtensionById (Oid extId)
 
ObjectAddress InsertExtensionTuple (const char *extName, Oid extOwner, Oid schemaOid, bool relocatable, const char *extVersion, Datum extConfig, Datum extCondition, List *requiredExtensions)
 
ObjectAddress ExecAlterExtensionStmt (ParseState *pstate, AlterExtensionStmt *stmt)
 
ObjectAddress ExecAlterExtensionContentsStmt (AlterExtensionContentsStmt *stmt, ObjectAddress *objAddr)
 
Oid get_extension_oid (const char *extname, bool missing_ok)
 
char * get_extension_name (Oid ext_oid)
 
Oid get_extension_schema (Oid ext_oid)
 
bool extension_file_exists (const char *extensionName)
 
ObjectAddress AlterExtensionNamespace (const char *extensionName, const char *newschema, Oid *oldschema)
 

Variables

PGDLLIMPORT bool creating_extension
 
PGDLLIMPORT Oid CurrentExtensionObject
 

Function Documentation

◆ AlterExtensionNamespace()

ObjectAddress AlterExtensionNamespace ( const char *  extensionName,
const char *  newschema,
Oid oldschema 
)

Definition at line 2771 of file extension.c.

2772 {
2773  Oid extensionOid;
2774  Oid nspOid;
2775  Oid oldNspOid;
2776  AclResult aclresult;
2777  Relation extRel;
2778  ScanKeyData key[2];
2779  SysScanDesc extScan;
2780  HeapTuple extTup;
2781  Form_pg_extension extForm;
2782  Relation depRel;
2783  SysScanDesc depScan;
2784  HeapTuple depTup;
2785  ObjectAddresses *objsMoved;
2786  ObjectAddress extAddr;
2787 
2788  extensionOid = get_extension_oid(extensionName, false);
2789 
2790  nspOid = LookupCreationNamespace(newschema);
2791 
2792  /*
2793  * Permission check: must own extension. Note that we don't bother to
2794  * check ownership of the individual member objects ...
2795  */
2796  if (!object_ownercheck(ExtensionRelationId, extensionOid, GetUserId()))
2798  extensionName);
2799 
2800  /* Permission check: must have creation rights in target namespace */
2801  aclresult = object_aclcheck(NamespaceRelationId, nspOid, GetUserId(), ACL_CREATE);
2802  if (aclresult != ACLCHECK_OK)
2803  aclcheck_error(aclresult, OBJECT_SCHEMA, newschema);
2804 
2805  /*
2806  * If the schema is currently a member of the extension, disallow moving
2807  * the extension into the schema. That would create a dependency loop.
2808  */
2809  if (getExtensionOfObject(NamespaceRelationId, nspOid) == extensionOid)
2810  ereport(ERROR,
2811  (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
2812  errmsg("cannot move extension \"%s\" into schema \"%s\" "
2813  "because the extension contains the schema",
2814  extensionName, newschema)));
2815 
2816  /* Locate the pg_extension tuple */
2817  extRel = table_open(ExtensionRelationId, RowExclusiveLock);
2818 
2819  ScanKeyInit(&key[0],
2820  Anum_pg_extension_oid,
2821  BTEqualStrategyNumber, F_OIDEQ,
2822  ObjectIdGetDatum(extensionOid));
2823 
2824  extScan = systable_beginscan(extRel, ExtensionOidIndexId, true,
2825  NULL, 1, key);
2826 
2827  extTup = systable_getnext(extScan);
2828 
2829  if (!HeapTupleIsValid(extTup)) /* should not happen */
2830  elog(ERROR, "could not find tuple for extension %u",
2831  extensionOid);
2832 
2833  /* Copy tuple so we can modify it below */
2834  extTup = heap_copytuple(extTup);
2835  extForm = (Form_pg_extension) GETSTRUCT(extTup);
2836 
2837  systable_endscan(extScan);
2838 
2839  /*
2840  * If the extension is already in the target schema, just silently do
2841  * nothing.
2842  */
2843  if (extForm->extnamespace == nspOid)
2844  {
2845  table_close(extRel, RowExclusiveLock);
2846  return InvalidObjectAddress;
2847  }
2848 
2849  /* Check extension is supposed to be relocatable */
2850  if (!extForm->extrelocatable)
2851  ereport(ERROR,
2852  (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2853  errmsg("extension \"%s\" does not support SET SCHEMA",
2854  NameStr(extForm->extname))));
2855 
2856  objsMoved = new_object_addresses();
2857 
2858  /* store the OID of the namespace to-be-changed */
2859  oldNspOid = extForm->extnamespace;
2860 
2861  /*
2862  * Scan pg_depend to find objects that depend directly on the extension,
2863  * and alter each one's schema.
2864  */
2865  depRel = table_open(DependRelationId, AccessShareLock);
2866 
2867  ScanKeyInit(&key[0],
2868  Anum_pg_depend_refclassid,
2869  BTEqualStrategyNumber, F_OIDEQ,
2870  ObjectIdGetDatum(ExtensionRelationId));
2871  ScanKeyInit(&key[1],
2872  Anum_pg_depend_refobjid,
2873  BTEqualStrategyNumber, F_OIDEQ,
2874  ObjectIdGetDatum(extensionOid));
2875 
2876  depScan = systable_beginscan(depRel, DependReferenceIndexId, true,
2877  NULL, 2, key);
2878 
2879  while (HeapTupleIsValid(depTup = systable_getnext(depScan)))
2880  {
2881  Form_pg_depend pg_depend = (Form_pg_depend) GETSTRUCT(depTup);
2882  ObjectAddress dep;
2883  Oid dep_oldNspOid;
2884 
2885  /*
2886  * If a dependent extension has a no_relocate request for this
2887  * extension, disallow SET SCHEMA. (XXX it's a bit ugly to do this in
2888  * the same loop that's actually executing the renames: we may detect
2889  * the error condition only after having expended a fair amount of
2890  * work. However, the alternative is to do two scans of pg_depend,
2891  * which seems like optimizing for failure cases. The rename work
2892  * will all roll back cleanly enough if we do fail here.)
2893  */
2894  if (pg_depend->deptype == DEPENDENCY_NORMAL &&
2895  pg_depend->classid == ExtensionRelationId)
2896  {
2897  char *depextname = get_extension_name(pg_depend->objid);
2898  ExtensionControlFile *dcontrol;
2899  ListCell *lc;
2900 
2901  dcontrol = read_extension_control_file(depextname);
2902  foreach(lc, dcontrol->no_relocate)
2903  {
2904  char *nrextname = (char *) lfirst(lc);
2905 
2906  if (strcmp(nrextname, NameStr(extForm->extname)) == 0)
2907  {
2908  ereport(ERROR,
2909  (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2910  errmsg("cannot SET SCHEMA of extension \"%s\" because other extensions prevent it",
2911  NameStr(extForm->extname)),
2912  errdetail("Extension \"%s\" requests no relocation of extension \"%s\".",
2913  depextname,
2914  NameStr(extForm->extname))));
2915  }
2916  }
2917  }
2918 
2919  /*
2920  * Otherwise, ignore non-membership dependencies. (Currently, the
2921  * only other case we could see here is a normal dependency from
2922  * another extension.)
2923  */
2924  if (pg_depend->deptype != DEPENDENCY_EXTENSION)
2925  continue;
2926 
2927  dep.classId = pg_depend->classid;
2928  dep.objectId = pg_depend->objid;
2929  dep.objectSubId = pg_depend->objsubid;
2930 
2931  if (dep.objectSubId != 0) /* should not happen */
2932  elog(ERROR, "extension should not have a sub-object dependency");
2933 
2934  /* Relocate the object */
2935  dep_oldNspOid = AlterObjectNamespace_oid(dep.classId,
2936  dep.objectId,
2937  nspOid,
2938  objsMoved);
2939 
2940  /*
2941  * If not all the objects had the same old namespace (ignoring any
2942  * that are not in namespaces), complain.
2943  */
2944  if (dep_oldNspOid != InvalidOid && dep_oldNspOid != oldNspOid)
2945  ereport(ERROR,
2946  (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2947  errmsg("extension \"%s\" does not support SET SCHEMA",
2948  NameStr(extForm->extname)),
2949  errdetail("%s is not in the extension's schema \"%s\"",
2950  getObjectDescription(&dep, false),
2951  get_namespace_name(oldNspOid))));
2952  }
2953 
2954  /* report old schema, if caller wants it */
2955  if (oldschema)
2956  *oldschema = oldNspOid;
2957 
2958  systable_endscan(depScan);
2959 
2961 
2962  /* Now adjust pg_extension.extnamespace */
2963  extForm->extnamespace = nspOid;
2964 
2965  CatalogTupleUpdate(extRel, &extTup->t_self, extTup);
2966 
2967  table_close(extRel, RowExclusiveLock);
2968 
2969  /* update dependency to point to the new schema */
2970  if (changeDependencyFor(ExtensionRelationId, extensionOid,
2971  NamespaceRelationId, oldNspOid, nspOid) != 1)
2972  elog(ERROR, "could not change schema dependency for extension %s",
2973  NameStr(extForm->extname));
2974 
2975  InvokeObjectPostAlterHook(ExtensionRelationId, extensionOid, 0);
2976 
2977  ObjectAddressSet(extAddr, ExtensionRelationId, extensionOid);
2978 
2979  return extAddr;
2980 }
AclResult
Definition: acl.h:181
@ ACLCHECK_OK
Definition: acl.h:182
@ ACLCHECK_NOT_OWNER
Definition: acl.h:184
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
Definition: aclchk.c:2669
AclResult object_aclcheck(Oid classid, Oid objectid, Oid roleid, AclMode mode)
Definition: aclchk.c:3760
bool object_ownercheck(Oid classid, Oid objectid, Oid roleid)
Definition: aclchk.c:3961
Oid AlterObjectNamespace_oid(Oid classId, Oid objid, Oid nspOid, ObjectAddresses *objsMoved)
Definition: alter.c:618
#define NameStr(name)
Definition: c.h:735
ObjectAddresses * new_object_addresses(void)
Definition: dependency.c:2532
@ DEPENDENCY_EXTENSION
Definition: dependency.h:38
@ DEPENDENCY_NORMAL
Definition: dependency.h:33
int errdetail(const char *fmt,...)
Definition: elog.c:1202
int errcode(int sqlerrcode)
Definition: elog.c:858
int errmsg(const char *fmt,...)
Definition: elog.c:1069
#define ERROR
Definition: elog.h:39
#define ereport(elevel,...)
Definition: elog.h:149
static ExtensionControlFile * read_extension_control_file(const char *extname)
Definition: extension.c:647
Oid get_extension_oid(const char *extname, bool missing_ok)
Definition: extension.c:144
char * get_extension_name(Oid ext_oid)
Definition: extension.c:189
void systable_endscan(SysScanDesc sysscan)
Definition: genam.c:599
HeapTuple systable_getnext(SysScanDesc sysscan)
Definition: genam.c:506
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
Definition: genam.c:387
HeapTuple heap_copytuple(HeapTuple tuple)
Definition: heaptuple.c:768
#define HeapTupleIsValid(tuple)
Definition: htup.h:78
#define GETSTRUCT(TUP)
Definition: htup_details.h:653
void CatalogTupleUpdate(Relation heapRel, ItemPointer otid, HeapTuple tup)
Definition: indexing.c:313
#define AccessShareLock
Definition: lockdefs.h:36
#define RowExclusiveLock
Definition: lockdefs.h:38
char * get_namespace_name(Oid nspid)
Definition: lsyscache.c:3348
Oid GetUserId(void)
Definition: miscinit.c:509
Oid LookupCreationNamespace(const char *nspname)
Definition: namespace.c:2961
#define InvokeObjectPostAlterHook(classId, objectId, subId)
Definition: objectaccess.h:197
char * getObjectDescription(const ObjectAddress *object, bool missing_ok)
const ObjectAddress InvalidObjectAddress
#define ObjectAddressSet(addr, class_id, object_id)
Definition: objectaddress.h:40
@ OBJECT_SCHEMA
Definition: parsenodes.h:2156
@ OBJECT_EXTENSION
Definition: parsenodes.h:2135
#define ACL_CREATE
Definition: parsenodes.h:92
long changeDependencyFor(Oid classId, Oid objectId, Oid refClassId, Oid oldRefObjectId, Oid newRefObjectId)
Definition: pg_depend.c:456
Oid getExtensionOfObject(Oid classId, Oid objectId)
Definition: pg_depend.c:731
FormData_pg_depend * Form_pg_depend
Definition: pg_depend.h:72
FormData_pg_extension * Form_pg_extension
Definition: pg_extension.h:52
#define lfirst(lc)
Definition: pg_list.h:172
static Datum ObjectIdGetDatum(Oid X)
Definition: postgres.h:252
#define InvalidOid
Definition: postgres_ext.h:36
unsigned int Oid
Definition: postgres_ext.h:31
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
Definition: scankey.c:76
void relation_close(Relation relation, LOCKMODE lockmode)
Definition: relation.c:206
#define BTEqualStrategyNumber
Definition: stratnum.h:31
ItemPointerData t_self
Definition: htup.h:65
void table_close(Relation relation, LOCKMODE lockmode)
Definition: table.c:126
Relation table_open(Oid relationId, LOCKMODE lockmode)
Definition: table.c:40

References AccessShareLock, ACL_CREATE, aclcheck_error(), ACLCHECK_NOT_OWNER, ACLCHECK_OK, AlterObjectNamespace_oid(), BTEqualStrategyNumber, CatalogTupleUpdate(), changeDependencyFor(), ObjectAddress::classId, DEPENDENCY_EXTENSION, DEPENDENCY_NORMAL, elog(), ereport, errcode(), errdetail(), errmsg(), ERROR, get_extension_name(), get_extension_oid(), get_namespace_name(), getExtensionOfObject(), getObjectDescription(), GETSTRUCT, GetUserId(), heap_copytuple(), HeapTupleIsValid, InvalidObjectAddress, InvalidOid, InvokeObjectPostAlterHook, sort-test::key, lfirst, LookupCreationNamespace(), NameStr, new_object_addresses(), ExtensionControlFile::no_relocate, object_aclcheck(), OBJECT_EXTENSION, object_ownercheck(), OBJECT_SCHEMA, ObjectAddressSet, ObjectAddress::objectId, ObjectIdGetDatum(), ObjectAddress::objectSubId, read_extension_control_file(), relation_close(), RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), and table_open().

Referenced by ExecAlterObjectSchemaStmt().

◆ CreateExtension()

ObjectAddress CreateExtension ( ParseState pstate,
CreateExtensionStmt stmt 
)

Definition at line 1767 of file extension.c.

1768 {
1769  DefElem *d_schema = NULL;
1770  DefElem *d_new_version = NULL;
1771  DefElem *d_cascade = NULL;
1772  char *schemaName = NULL;
1773  char *versionName = NULL;
1774  bool cascade = false;
1775  ListCell *lc;
1776 
1777  /* Check extension name validity before any filesystem access */
1778  check_valid_extension_name(stmt->extname);
1779 
1780  /*
1781  * Check for duplicate extension name. The unique index on
1782  * pg_extension.extname would catch this anyway, and serves as a backstop
1783  * in case of race conditions; but this is a friendlier error message, and
1784  * besides we need a check to support IF NOT EXISTS.
1785  */
1786  if (get_extension_oid(stmt->extname, true) != InvalidOid)
1787  {
1788  if (stmt->if_not_exists)
1789  {
1790  ereport(NOTICE,
1792  errmsg("extension \"%s\" already exists, skipping",
1793  stmt->extname)));
1794  return InvalidObjectAddress;
1795  }
1796  else
1797  ereport(ERROR,
1799  errmsg("extension \"%s\" already exists",
1800  stmt->extname)));
1801  }
1802 
1803  /*
1804  * We use global variables to track the extension being created, so we can
1805  * create only one extension at the same time.
1806  */
1807  if (creating_extension)
1808  ereport(ERROR,
1809  (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1810  errmsg("nested CREATE EXTENSION is not supported")));
1811 
1812  /* Deconstruct the statement option list */
1813  foreach(lc, stmt->options)
1814  {
1815  DefElem *defel = (DefElem *) lfirst(lc);
1816 
1817  if (strcmp(defel->defname, "schema") == 0)
1818  {
1819  if (d_schema)
1820  errorConflictingDefElem(defel, pstate);
1821  d_schema = defel;
1822  schemaName = defGetString(d_schema);
1823  }
1824  else if (strcmp(defel->defname, "new_version") == 0)
1825  {
1826  if (d_new_version)
1827  errorConflictingDefElem(defel, pstate);
1828  d_new_version = defel;
1829  versionName = defGetString(d_new_version);
1830  }
1831  else if (strcmp(defel->defname, "cascade") == 0)
1832  {
1833  if (d_cascade)
1834  errorConflictingDefElem(defel, pstate);
1835  d_cascade = defel;
1836  cascade = defGetBoolean(d_cascade);
1837  }
1838  else
1839  elog(ERROR, "unrecognized option: %s", defel->defname);
1840  }
1841 
1842  /* Call CreateExtensionInternal to do the real work. */
1843  return CreateExtensionInternal(stmt->extname,
1844  schemaName,
1845  versionName,
1846  cascade,
1847  NIL,
1848  true);
1849 }
bool defGetBoolean(DefElem *def)
Definition: define.c:108
char * defGetString(DefElem *def)
Definition: define.c:49
void errorConflictingDefElem(DefElem *defel, ParseState *pstate)
Definition: define.c:385
#define NOTICE
Definition: elog.h:35
static void check_valid_extension_name(const char *extensionname)
Definition: extension.c:265
bool creating_extension
Definition: extension.c:73
static ObjectAddress CreateExtensionInternal(char *extensionName, char *schemaName, const char *versionName, bool cascade, List *parents, bool is_create)
Definition: extension.c:1457
#define stmt
Definition: indent_codes.h:59
#define NIL
Definition: pg_list.h:68
#define ERRCODE_DUPLICATE_OBJECT
Definition: streamutil.c:32
char * defname
Definition: parsenodes.h:809

References check_valid_extension_name(), CreateExtensionInternal(), creating_extension, defGetBoolean(), defGetString(), DefElem::defname, elog(), ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, errorConflictingDefElem(), get_extension_oid(), InvalidObjectAddress, InvalidOid, lfirst, NIL, NOTICE, and stmt.

Referenced by ProcessUtilitySlow().

◆ ExecAlterExtensionContentsStmt()

ObjectAddress ExecAlterExtensionContentsStmt ( AlterExtensionContentsStmt stmt,
ObjectAddress objAddr 
)

Definition at line 3291 of file extension.c.

3293 {
3294  ObjectAddress extension;
3295  ObjectAddress object;
3296  Relation relation;
3297  Oid oldExtension;
3298 
3299  switch (stmt->objtype)
3300  {
3301  case OBJECT_DATABASE:
3302  case OBJECT_EXTENSION:
3303  case OBJECT_INDEX:
3304  case OBJECT_PUBLICATION:
3305  case OBJECT_ROLE:
3306  case OBJECT_STATISTIC_EXT:
3307  case OBJECT_SUBSCRIPTION:
3308  case OBJECT_TABLESPACE:
3309  ereport(ERROR,
3310  (errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
3311  errmsg("cannot add an object of this type to an extension")));
3312  break;
3313  default:
3314  /* OK */
3315  break;
3316  }
3317 
3318  /*
3319  * Find the extension and acquire a lock on it, to ensure it doesn't get
3320  * dropped concurrently. A sharable lock seems sufficient: there's no
3321  * reason not to allow other sorts of manipulations, such as add/drop of
3322  * other objects, to occur concurrently. Concurrently adding/dropping the
3323  * *same* object would be bad, but we prevent that by using a non-sharable
3324  * lock on the individual object, below.
3325  */
3327  (Node *) makeString(stmt->extname),
3328  &relation, AccessShareLock, false);
3329 
3330  /* Permission check: must own extension */
3331  if (!object_ownercheck(ExtensionRelationId, extension.objectId, GetUserId()))
3333  stmt->extname);
3334 
3335  /*
3336  * Translate the parser representation that identifies the object into an
3337  * ObjectAddress. get_object_address() will throw an error if the object
3338  * does not exist, and will also acquire a lock on the object to guard
3339  * against concurrent DROP and ALTER EXTENSION ADD/DROP operations.
3340  */
3341  object = get_object_address(stmt->objtype, stmt->object,
3342  &relation, ShareUpdateExclusiveLock, false);
3343 
3344  Assert(object.objectSubId == 0);
3345  if (objAddr)
3346  *objAddr = object;
3347 
3348  /* Permission check: must own target object, too */
3349  check_object_ownership(GetUserId(), stmt->objtype, object,
3350  stmt->object, relation);
3351 
3352  /*
3353  * Check existing extension membership.
3354  */
3355  oldExtension = getExtensionOfObject(object.classId, object.objectId);
3356 
3357  if (stmt->action > 0)
3358  {
3359  /*
3360  * ADD, so complain if object is already attached to some extension.
3361  */
3362  if (OidIsValid(oldExtension))
3363  ereport(ERROR,
3364  (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
3365  errmsg("%s is already a member of extension \"%s\"",
3366  getObjectDescription(&object, false),
3367  get_extension_name(oldExtension))));
3368 
3369  /*
3370  * Prevent a schema from being added to an extension if the schema
3371  * contains the extension. That would create a dependency loop.
3372  */
3373  if (object.classId == NamespaceRelationId &&
3374  object.objectId == get_extension_schema(extension.objectId))
3375  ereport(ERROR,
3376  (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
3377  errmsg("cannot add schema \"%s\" to extension \"%s\" "
3378  "because the schema contains the extension",
3379  get_namespace_name(object.objectId),
3380  stmt->extname)));
3381 
3382  /*
3383  * OK, add the dependency.
3384  */
3385  recordDependencyOn(&object, &extension, DEPENDENCY_EXTENSION);
3386 
3387  /*
3388  * Also record the initial ACL on the object, if any.
3389  *
3390  * Note that this will handle the object's ACLs, as well as any ACLs
3391  * on object subIds. (In other words, when the object is a table,
3392  * this will record the table's ACL and the ACLs for the columns on
3393  * the table, if any).
3394  */
3395  recordExtObjInitPriv(object.objectId, object.classId);
3396  }
3397  else
3398  {
3399  /*
3400  * DROP, so complain if it's not a member.
3401  */
3402  if (oldExtension != extension.objectId)
3403  ereport(ERROR,
3404  (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
3405  errmsg("%s is not a member of extension \"%s\"",
3406  getObjectDescription(&object, false),
3407  stmt->extname)));
3408 
3409  /*
3410  * OK, drop the dependency.
3411  */
3412  if (deleteDependencyRecordsForClass(object.classId, object.objectId,
3413  ExtensionRelationId,
3414  DEPENDENCY_EXTENSION) != 1)
3415  elog(ERROR, "unexpected number of extension dependency records");
3416 
3417  /*
3418  * If it's a relation, it might have an entry in the extension's
3419  * extconfig array, which we must remove.
3420  */
3421  if (object.classId == RelationRelationId)
3422  extension_config_remove(extension.objectId, object.objectId);
3423 
3424  /*
3425  * Remove all the initial ACLs, if any.
3426  *
3427  * Note that this will remove the object's ACLs, as well as any ACLs
3428  * on object subIds. (In other words, when the object is a table,
3429  * this will remove the table's ACL and the ACLs for the columns on
3430  * the table, if any).
3431  */
3432  removeExtObjInitPriv(object.objectId, object.classId);
3433  }
3434 
3435  InvokeObjectPostAlterHook(ExtensionRelationId, extension.objectId, 0);
3436 
3437  /*
3438  * If get_object_address() opened the relation for us, we close it to keep
3439  * the reference count correct - but we retain any locks acquired by
3440  * get_object_address() until commit time, to guard against concurrent
3441  * activity.
3442  */
3443  if (relation != NULL)
3444  relation_close(relation, NoLock);
3445 
3446  return extension;
3447 }
void recordExtObjInitPriv(Oid objoid, Oid classoid)
Definition: aclchk.c:4219
void removeExtObjInitPriv(Oid objoid, Oid classoid)
Definition: aclchk.c:4382
#define OidIsValid(objectId)
Definition: c.h:764
Oid get_extension_schema(Oid ext_oid)
Definition: extension.c:228
static void extension_config_remove(Oid extensionoid, Oid tableoid)
Definition: extension.c:2606
Assert(fmt[strlen(fmt) - 1] !='\n')
#define NoLock
Definition: lockdefs.h:34
#define ShareUpdateExclusiveLock
Definition: lockdefs.h:39
void check_object_ownership(Oid roleid, ObjectType objtype, ObjectAddress address, Node *object, Relation relation)
ObjectAddress get_object_address(ObjectType objtype, Node *object, Relation *relp, LOCKMODE lockmode, bool missing_ok)
@ OBJECT_TABLESPACE
Definition: parsenodes.h:2162
@ OBJECT_ROLE
Definition: parsenodes.h:2153
@ OBJECT_INDEX
Definition: parsenodes.h:2140
@ OBJECT_DATABASE
Definition: parsenodes.h:2129
@ OBJECT_PUBLICATION
Definition: parsenodes.h:2150
@ OBJECT_SUBSCRIPTION
Definition: parsenodes.h:2158
@ OBJECT_STATISTIC_EXT
Definition: parsenodes.h:2159
void recordDependencyOn(const ObjectAddress *depender, const ObjectAddress *referenced, DependencyType behavior)
Definition: pg_depend.c:44
long deleteDependencyRecordsForClass(Oid classId, Oid objectId, Oid refclassId, char deptype)
Definition: pg_depend.c:350
Definition: nodes.h:129
String * makeString(char *str)
Definition: value.c:63

References AccessShareLock, aclcheck_error(), ACLCHECK_NOT_OWNER, Assert(), check_object_ownership(), deleteDependencyRecordsForClass(), DEPENDENCY_EXTENSION, elog(), ereport, errcode(), errmsg(), ERROR, extension_config_remove(), get_extension_name(), get_extension_schema(), get_namespace_name(), get_object_address(), getExtensionOfObject(), getObjectDescription(), GetUserId(), InvokeObjectPostAlterHook, makeString(), NoLock, OBJECT_DATABASE, OBJECT_EXTENSION, OBJECT_INDEX, object_ownercheck(), OBJECT_PUBLICATION, OBJECT_ROLE, OBJECT_STATISTIC_EXT, OBJECT_SUBSCRIPTION, OBJECT_TABLESPACE, ObjectAddress::objectId, OidIsValid, recordDependencyOn(), recordExtObjInitPriv(), relation_close(), removeExtObjInitPriv(), ShareUpdateExclusiveLock, and stmt.

Referenced by ProcessUtilitySlow().

◆ ExecAlterExtensionStmt()

ObjectAddress ExecAlterExtensionStmt ( ParseState pstate,
AlterExtensionStmt stmt 
)

Definition at line 2986 of file extension.c.

2987 {
2988  DefElem *d_new_version = NULL;
2989  char *versionName;
2990  char *oldVersionName;
2991  ExtensionControlFile *control;
2992  Oid extensionOid;
2993  Relation extRel;
2994  ScanKeyData key[1];
2995  SysScanDesc extScan;
2996  HeapTuple extTup;
2997  List *updateVersions;
2998  Datum datum;
2999  bool isnull;
3000  ListCell *lc;
3001  ObjectAddress address;
3002 
3003  /*
3004  * We use global variables to track the extension being created, so we can
3005  * create/update only one extension at the same time.
3006  */
3007  if (creating_extension)
3008  ereport(ERROR,
3009  (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3010  errmsg("nested ALTER EXTENSION is not supported")));
3011 
3012  /*
3013  * Look up the extension --- it must already exist in pg_extension
3014  */
3015  extRel = table_open(ExtensionRelationId, AccessShareLock);
3016 
3017  ScanKeyInit(&key[0],
3018  Anum_pg_extension_extname,
3019  BTEqualStrategyNumber, F_NAMEEQ,
3020  CStringGetDatum(stmt->extname));
3021 
3022  extScan = systable_beginscan(extRel, ExtensionNameIndexId, true,
3023  NULL, 1, key);
3024 
3025  extTup = systable_getnext(extScan);
3026 
3027  if (!HeapTupleIsValid(extTup))
3028  ereport(ERROR,
3029  (errcode(ERRCODE_UNDEFINED_OBJECT),
3030  errmsg("extension \"%s\" does not exist",
3031  stmt->extname)));
3032 
3033  extensionOid = ((Form_pg_extension) GETSTRUCT(extTup))->oid;
3034 
3035  /*
3036  * Determine the existing version we are updating from
3037  */
3038  datum = heap_getattr(extTup, Anum_pg_extension_extversion,
3039  RelationGetDescr(extRel), &isnull);
3040  if (isnull)
3041  elog(ERROR, "extversion is null");
3042  oldVersionName = text_to_cstring(DatumGetTextPP(datum));
3043 
3044  systable_endscan(extScan);
3045 
3046  table_close(extRel, AccessShareLock);
3047 
3048  /* Permission check: must own extension */
3049  if (!object_ownercheck(ExtensionRelationId, extensionOid, GetUserId()))
3051  stmt->extname);
3052 
3053  /*
3054  * Read the primary control file. Note we assume that it does not contain
3055  * any non-ASCII data, so there is no need to worry about encoding at this
3056  * point.
3057  */
3058  control = read_extension_control_file(stmt->extname);
3059 
3060  /*
3061  * Read the statement option list
3062  */
3063  foreach(lc, stmt->options)
3064  {
3065  DefElem *defel = (DefElem *) lfirst(lc);
3066 
3067  if (strcmp(defel->defname, "new_version") == 0)
3068  {
3069  if (d_new_version)
3070  errorConflictingDefElem(defel, pstate);
3071  d_new_version = defel;
3072  }
3073  else
3074  elog(ERROR, "unrecognized option: %s", defel->defname);
3075  }
3076 
3077  /*
3078  * Determine the version to update to
3079  */
3080  if (d_new_version && d_new_version->arg)
3081  versionName = strVal(d_new_version->arg);
3082  else if (control->default_version)
3083  versionName = control->default_version;
3084  else
3085  {
3086  ereport(ERROR,
3087  (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
3088  errmsg("version to install must be specified")));
3089  versionName = NULL; /* keep compiler quiet */
3090  }
3091  check_valid_version_name(versionName);
3092 
3093  /*
3094  * If we're already at that version, just say so
3095  */
3096  if (strcmp(oldVersionName, versionName) == 0)
3097  {
3098  ereport(NOTICE,
3099  (errmsg("version \"%s\" of extension \"%s\" is already installed",
3100  versionName, stmt->extname)));
3101  return InvalidObjectAddress;
3102  }
3103 
3104  /*
3105  * Identify the series of update script files we need to execute
3106  */
3107  updateVersions = identify_update_path(control,
3108  oldVersionName,
3109  versionName);
3110 
3111  /*
3112  * Update the pg_extension row and execute the update scripts, one at a
3113  * time
3114  */
3115  ApplyExtensionUpdates(extensionOid, control,
3116  oldVersionName, updateVersions,
3117  NULL, false, false);
3118 
3119  ObjectAddressSet(address, ExtensionRelationId, extensionOid);
3120 
3121  return address;
3122 }
static List * identify_update_path(ExtensionControlFile *control, const char *oldVersion, const char *newVersion)
Definition: extension.c:1266
static void check_valid_version_name(const char *versionname)
Definition: extension.c:312
static void ApplyExtensionUpdates(Oid extensionOid, ExtensionControlFile *pcontrol, const char *initialVersion, List *updateVersions, char *origSchemaName, bool cascade, bool is_create)
Definition: extension.c:3133
#define DatumGetTextPP(X)
Definition: fmgr.h:292
static Datum heap_getattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
Definition: htup_details.h:792
uintptr_t Datum
Definition: postgres.h:64
static Datum CStringGetDatum(const char *X)
Definition: postgres.h:350
#define RelationGetDescr(relation)
Definition: rel.h:530
Node * arg
Definition: parsenodes.h:810
char * default_version
Definition: extension.c:83
Definition: pg_list.h:54
#define strVal(v)
Definition: value.h:82
char * text_to_cstring(const text *t)
Definition: varlena.c:215

References AccessShareLock, aclcheck_error(), ACLCHECK_NOT_OWNER, ApplyExtensionUpdates(), DefElem::arg, BTEqualStrategyNumber, check_valid_version_name(), creating_extension, CStringGetDatum(), DatumGetTextPP, ExtensionControlFile::default_version, DefElem::defname, elog(), ereport, errcode(), errmsg(), ERROR, errorConflictingDefElem(), GETSTRUCT, GetUserId(), heap_getattr(), HeapTupleIsValid, identify_update_path(), InvalidObjectAddress, sort-test::key, lfirst, NOTICE, OBJECT_EXTENSION, object_ownercheck(), ObjectAddressSet, read_extension_control_file(), RelationGetDescr, ScanKeyInit(), stmt, strVal, systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), table_open(), and text_to_cstring().

Referenced by ProcessUtilitySlow().

◆ extension_file_exists()

bool extension_file_exists ( const char *  extensionName)

Definition at line 2259 of file extension.c.

2260 {
2261  bool result = false;
2262  char *location;
2263  DIR *dir;
2264  struct dirent *de;
2265 
2266  location = get_extension_control_directory();
2267  dir = AllocateDir(location);
2268 
2269  /*
2270  * If the control directory doesn't exist, we want to silently return
2271  * false. Any other error will be reported by ReadDir.
2272  */
2273  if (dir == NULL && errno == ENOENT)
2274  {
2275  /* do nothing */
2276  }
2277  else
2278  {
2279  while ((de = ReadDir(dir, location)) != NULL)
2280  {
2281  char *extname;
2282 
2284  continue;
2285 
2286  /* extract extension name from 'name.control' filename */
2287  extname = pstrdup(de->d_name);
2288  *strrchr(extname, '.') = '\0';
2289 
2290  /* ignore it if it's an auxiliary control file */
2291  if (strstr(extname, "--"))
2292  continue;
2293 
2294  /* done if it matches request */
2295  if (strcmp(extname, extensionName) == 0)
2296  {
2297  result = true;
2298  break;
2299  }
2300  }
2301 
2302  FreeDir(dir);
2303  }
2304 
2305  return result;
2306 }
static bool is_extension_control_filename(const char *filename)
Definition: extension.c:359
static char * get_extension_control_directory(void)
Definition: extension.c:375
struct dirent * ReadDir(DIR *dir, const char *dirname)
Definition: fd.c:2854
int FreeDir(DIR *dir)
Definition: fd.c:2906
DIR * AllocateDir(const char *dirname)
Definition: fd.c:2788
char * pstrdup(const char *in)
Definition: mcxt.c:1644
Definition: dirent.c:26
Definition: dirent.h:10
char d_name[MAX_PATH]
Definition: dirent.h:15

References AllocateDir(), dirent::d_name, FreeDir(), get_extension_control_directory(), is_extension_control_filename(), pstrdup(), and ReadDir().

Referenced by CreateFunction(), and ExecuteDoStmt().

◆ get_extension_name()

char* get_extension_name ( Oid  ext_oid)

Definition at line 189 of file extension.c.

190 {
191  char *result;
192  Relation rel;
193  SysScanDesc scandesc;
194  HeapTuple tuple;
195  ScanKeyData entry[1];
196 
197  rel = table_open(ExtensionRelationId, AccessShareLock);
198 
199  ScanKeyInit(&entry[0],
200  Anum_pg_extension_oid,
201  BTEqualStrategyNumber, F_OIDEQ,
202  ObjectIdGetDatum(ext_oid));
203 
204  scandesc = systable_beginscan(rel, ExtensionOidIndexId, true,
205  NULL, 1, entry);
206 
207  tuple = systable_getnext(scandesc);
208 
209  /* We assume that there can be at most one matching tuple */
210  if (HeapTupleIsValid(tuple))
211  result = pstrdup(NameStr(((Form_pg_extension) GETSTRUCT(tuple))->extname));
212  else
213  result = NULL;
214 
215  systable_endscan(scandesc);
216 
218 
219  return result;
220 }

References AccessShareLock, BTEqualStrategyNumber, GETSTRUCT, HeapTupleIsValid, NameStr, ObjectIdGetDatum(), pstrdup(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().

Referenced by AlterExtensionNamespace(), checkMembershipInCurrentExtension(), ExecAlterExtensionContentsStmt(), getObjectDescription(), getObjectIdentityParts(), recordDependencyOnCurrentExtension(), and RemoveExtensionById().

◆ get_extension_oid()

Oid get_extension_oid ( const char *  extname,
bool  missing_ok 
)

Definition at line 144 of file extension.c.

145 {
146  Oid result;
147  Relation rel;
148  SysScanDesc scandesc;
149  HeapTuple tuple;
150  ScanKeyData entry[1];
151 
152  rel = table_open(ExtensionRelationId, AccessShareLock);
153 
154  ScanKeyInit(&entry[0],
155  Anum_pg_extension_extname,
156  BTEqualStrategyNumber, F_NAMEEQ,
157  CStringGetDatum(extname));
158 
159  scandesc = systable_beginscan(rel, ExtensionNameIndexId, true,
160  NULL, 1, entry);
161 
162  tuple = systable_getnext(scandesc);
163 
164  /* We assume that there can be at most one matching tuple */
165  if (HeapTupleIsValid(tuple))
166  result = ((Form_pg_extension) GETSTRUCT(tuple))->oid;
167  else
168  result = InvalidOid;
169 
170  systable_endscan(scandesc);
171 
173 
174  if (!OidIsValid(result) && !missing_ok)
175  ereport(ERROR,
176  (errcode(ERRCODE_UNDEFINED_OBJECT),
177  errmsg("extension \"%s\" does not exist",
178  extname)));
179 
180  return result;
181 }

References AccessShareLock, BTEqualStrategyNumber, CStringGetDatum(), ereport, errcode(), errmsg(), ERROR, GETSTRUCT, HeapTupleIsValid, InvalidOid, OidIsValid, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().

Referenced by AlterExtensionNamespace(), binary_upgrade_create_empty_extension(), CreateExtension(), ExtractExtensionList(), get_object_address_unqualified(), and get_required_extension().

◆ get_extension_schema()

Oid get_extension_schema ( Oid  ext_oid)

Definition at line 228 of file extension.c.

229 {
230  Oid result;
231  Relation rel;
232  SysScanDesc scandesc;
233  HeapTuple tuple;
234  ScanKeyData entry[1];
235 
236  rel = table_open(ExtensionRelationId, AccessShareLock);
237 
238  ScanKeyInit(&entry[0],
239  Anum_pg_extension_oid,
240  BTEqualStrategyNumber, F_OIDEQ,
241  ObjectIdGetDatum(ext_oid));
242 
243  scandesc = systable_beginscan(rel, ExtensionOidIndexId, true,
244  NULL, 1, entry);
245 
246  tuple = systable_getnext(scandesc);
247 
248  /* We assume that there can be at most one matching tuple */
249  if (HeapTupleIsValid(tuple))
250  result = ((Form_pg_extension) GETSTRUCT(tuple))->extnamespace;
251  else
252  result = InvalidOid;
253 
254  systable_endscan(scandesc);
255 
257 
258  return result;
259 }

References AccessShareLock, BTEqualStrategyNumber, GETSTRUCT, HeapTupleIsValid, InvalidOid, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().

Referenced by ApplyExtensionUpdates(), CreateExtensionInternal(), and ExecAlterExtensionContentsStmt().

◆ InsertExtensionTuple()

ObjectAddress InsertExtensionTuple ( const char *  extName,
Oid  extOwner,
Oid  schemaOid,
bool  relocatable,
const char *  extVersion,
Datum  extConfig,
Datum  extCondition,
List requiredExtensions 
)

Definition at line 1865 of file extension.c.

1869 {
1870  Oid extensionOid;
1871  Relation rel;
1872  Datum values[Natts_pg_extension];
1873  bool nulls[Natts_pg_extension];
1874  HeapTuple tuple;
1875  ObjectAddress myself;
1876  ObjectAddress nsp;
1877  ObjectAddresses *refobjs;
1878  ListCell *lc;
1879 
1880  /*
1881  * Build and insert the pg_extension tuple
1882  */
1883  rel = table_open(ExtensionRelationId, RowExclusiveLock);
1884 
1885  memset(values, 0, sizeof(values));
1886  memset(nulls, 0, sizeof(nulls));
1887 
1888  extensionOid = GetNewOidWithIndex(rel, ExtensionOidIndexId,
1889  Anum_pg_extension_oid);
1890  values[Anum_pg_extension_oid - 1] = ObjectIdGetDatum(extensionOid);
1891  values[Anum_pg_extension_extname - 1] =
1893  values[Anum_pg_extension_extowner - 1] = ObjectIdGetDatum(extOwner);
1894  values[Anum_pg_extension_extnamespace - 1] = ObjectIdGetDatum(schemaOid);
1895  values[Anum_pg_extension_extrelocatable - 1] = BoolGetDatum(relocatable);
1896  values[Anum_pg_extension_extversion - 1] = CStringGetTextDatum(extVersion);
1897 
1898  if (extConfig == PointerGetDatum(NULL))
1899  nulls[Anum_pg_extension_extconfig - 1] = true;
1900  else
1901  values[Anum_pg_extension_extconfig - 1] = extConfig;
1902 
1903  if (extCondition == PointerGetDatum(NULL))
1904  nulls[Anum_pg_extension_extcondition - 1] = true;
1905  else
1906  values[Anum_pg_extension_extcondition - 1] = extCondition;
1907 
1908  tuple = heap_form_tuple(rel->rd_att, values, nulls);
1909 
1910  CatalogTupleInsert(rel, tuple);
1911 
1912  heap_freetuple(tuple);
1914 
1915  /*
1916  * Record dependencies on owner, schema, and prerequisite extensions
1917  */
1918  recordDependencyOnOwner(ExtensionRelationId, extensionOid, extOwner);
1919 
1920  refobjs = new_object_addresses();
1921 
1922  ObjectAddressSet(myself, ExtensionRelationId, extensionOid);
1923 
1924  ObjectAddressSet(nsp, NamespaceRelationId, schemaOid);
1925  add_exact_object_address(&nsp, refobjs);
1926 
1927  foreach(lc, requiredExtensions)
1928  {
1929  Oid reqext = lfirst_oid(lc);
1930  ObjectAddress otherext;
1931 
1932  ObjectAddressSet(otherext, ExtensionRelationId, reqext);
1933  add_exact_object_address(&otherext, refobjs);
1934  }
1935 
1936  /* Record all of them (this includes duplicate elimination) */
1938  free_object_addresses(refobjs);
1939 
1940  /* Post creation hook for new extension */
1941  InvokeObjectPostCreateHook(ExtensionRelationId, extensionOid, 0);
1942 
1943  return myself;
1944 }
static Datum values[MAXATTR]
Definition: bootstrap.c:156
#define CStringGetTextDatum(s)
Definition: builtins.h:94
Oid GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn)
Definition: catalog.c:393
void record_object_address_dependencies(const ObjectAddress *depender, ObjectAddresses *referenced, DependencyType behavior)
Definition: dependency.c:2790
void add_exact_object_address(const ObjectAddress *object, ObjectAddresses *addrs)
Definition: dependency.c:2581
void free_object_addresses(ObjectAddresses *addrs)
Definition: dependency.c:2821
#define DirectFunctionCall1(func, arg1)
Definition: fmgr.h:642
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, Datum *values, bool *isnull)
Definition: heaptuple.c:1108
void heap_freetuple(HeapTuple htup)
Definition: heaptuple.c:1426
void CatalogTupleInsert(Relation heapRel, HeapTuple tup)
Definition: indexing.c:233
Datum namein(PG_FUNCTION_ARGS)
Definition: name.c:48
#define InvokeObjectPostCreateHook(classId, objectId, subId)
Definition: objectaccess.h:173
#define lfirst_oid(lc)
Definition: pg_list.h:174
void recordDependencyOnOwner(Oid classId, Oid objectId, Oid owner)
Definition: pg_shdepend.c:165
static Datum PointerGetDatum(const void *X)
Definition: postgres.h:322
static Datum BoolGetDatum(bool X)
Definition: postgres.h:102
TupleDesc rd_att
Definition: rel.h:112

References add_exact_object_address(), BoolGetDatum(), CatalogTupleInsert(), CStringGetDatum(), CStringGetTextDatum, DEPENDENCY_NORMAL, DirectFunctionCall1, free_object_addresses(), GetNewOidWithIndex(), heap_form_tuple(), heap_freetuple(), InvokeObjectPostCreateHook, lfirst_oid, namein(), new_object_addresses(), ObjectAddressSet, ObjectIdGetDatum(), PointerGetDatum(), RelationData::rd_att, record_object_address_dependencies(), recordDependencyOnOwner(), RowExclusiveLock, table_close(), table_open(), and values.

Referenced by binary_upgrade_create_empty_extension(), and CreateExtensionInternal().

◆ RemoveExtensionById()

void RemoveExtensionById ( Oid  extId)

Definition at line 1953 of file extension.c.

1954 {
1955  Relation rel;
1956  SysScanDesc scandesc;
1957  HeapTuple tuple;
1958  ScanKeyData entry[1];
1959 
1960  /*
1961  * Disallow deletion of any extension that's currently open for insertion;
1962  * else subsequent executions of recordDependencyOnCurrentExtension()
1963  * could create dangling pg_depend records that refer to a no-longer-valid
1964  * pg_extension OID. This is needed not so much because we think people
1965  * might write "DROP EXTENSION foo" in foo's own script files, as because
1966  * errors in dependency management in extension script files could give
1967  * rise to cases where an extension is dropped as a result of recursing
1968  * from some contained object. Because of that, we must test for the case
1969  * here, not at some higher level of the DROP EXTENSION command.
1970  */
1971  if (extId == CurrentExtensionObject)
1972  ereport(ERROR,
1973  (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1974  errmsg("cannot drop extension \"%s\" because it is being modified",
1975  get_extension_name(extId))));
1976 
1977  rel = table_open(ExtensionRelationId, RowExclusiveLock);
1978 
1979  ScanKeyInit(&entry[0],
1980  Anum_pg_extension_oid,
1981  BTEqualStrategyNumber, F_OIDEQ,
1982  ObjectIdGetDatum(extId));
1983  scandesc = systable_beginscan(rel, ExtensionOidIndexId, true,
1984  NULL, 1, entry);
1985 
1986  tuple = systable_getnext(scandesc);
1987 
1988  /* We assume that there can be at most one matching tuple */
1989  if (HeapTupleIsValid(tuple))
1990  CatalogTupleDelete(rel, &tuple->t_self);
1991 
1992  systable_endscan(scandesc);
1993 
1995 }
Oid CurrentExtensionObject
Definition: extension.c:74
void CatalogTupleDelete(Relation heapRel, ItemPointer tid)
Definition: indexing.c:365

References BTEqualStrategyNumber, CatalogTupleDelete(), CurrentExtensionObject, ereport, errcode(), errmsg(), ERROR, get_extension_name(), HeapTupleIsValid, ObjectIdGetDatum(), RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), and table_open().

Referenced by doDeletion().

Variable Documentation

◆ creating_extension

◆ CurrentExtensionObject