mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +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:
@ -388,20 +388,25 @@ create_proc_lang(const char *languageName, bool replace,
|
||||
* Create dependencies for the new language. If we are updating an
|
||||
* existing language, first delete any existing pg_depend entries.
|
||||
* (However, since we are not changing ownership or permissions, the
|
||||
* shared dependencies do *not* need to change, and we leave them alone.)
|
||||
* shared dependencies do *not* need to change, and we leave them alone.
|
||||
* We also don't change any pre-existing extension-membership dependency.)
|
||||
*/
|
||||
myself.classId = LanguageRelationId;
|
||||
myself.objectId = HeapTupleGetOid(tup);
|
||||
myself.objectSubId = 0;
|
||||
|
||||
if (is_update)
|
||||
deleteDependencyRecordsFor(myself.classId, myself.objectId);
|
||||
deleteDependencyRecordsFor(myself.classId, myself.objectId, true);
|
||||
|
||||
/* dependency on owner of language */
|
||||
if (!is_update)
|
||||
recordDependencyOnOwner(myself.classId, myself.objectId,
|
||||
languageOwner);
|
||||
|
||||
/* dependency on extension */
|
||||
if (!is_update)
|
||||
recordDependencyOnCurrentExtension(&myself);
|
||||
|
||||
/* dependency on the PL handler function */
|
||||
referenced.classId = ProcedureRelationId;
|
||||
referenced.objectId = handlerOid;
|
||||
|
Reference in New Issue
Block a user