mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Core support for "extensions", which are packages of SQL objects.
This patch adds the server infrastructure to support extensions. There is still one significant loose end, namely how to make it play nice with pg_upgrade, so I am not yet committing the changes that would make all the contrib modules depend on this feature. In passing, fix a disturbingly large amount of breakage in AlterObjectNamespace() and callers. Dimitri Fontaine, reviewed by Anssi Kääriäinen, Itagaki Takahiro, Tom Lane, and numerous others
This commit is contained in:
@@ -38,6 +38,7 @@ NamespaceCreate(const char *nspName, Oid ownerId)
|
||||
Datum values[Natts_pg_namespace];
|
||||
NameData nname;
|
||||
TupleDesc tupDesc;
|
||||
ObjectAddress myself;
|
||||
int i;
|
||||
|
||||
/* sanity checks */
|
||||
@@ -73,9 +74,17 @@ NamespaceCreate(const char *nspName, Oid ownerId)
|
||||
|
||||
heap_close(nspdesc, RowExclusiveLock);
|
||||
|
||||
/* Record dependency on owner */
|
||||
/* Record dependencies */
|
||||
myself.classId = NamespaceRelationId;
|
||||
myself.objectId = nspoid;
|
||||
myself.objectSubId = 0;
|
||||
|
||||
/* dependency on owner */
|
||||
recordDependencyOnOwner(NamespaceRelationId, nspoid, ownerId);
|
||||
|
||||
/* dependency on extension */
|
||||
recordDependencyOnCurrentExtension(&myself);
|
||||
|
||||
/* Post creation hook for new schema */
|
||||
InvokeObjectAccessHook(OAT_POST_CREATE, NamespaceRelationId, nspoid, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user