diff options
author | Michael Paquier | 2023-03-07 05:18:20 +0000 |
---|---|---|
committer | Michael Paquier | 2023-03-07 05:18:20 +0000 |
commit | e20b1ea1575cb523821d51e9934d8d6dab835335 (patch) | |
tree | 28e33930d10005edbbcf1a67603e8f4364812228 | |
parent | cf96907aadca454c4094819c2ecddee07eafe203 (diff) |
Make get_extension_schema() available
This routine is able to retrieve the OID of the schema used with an
extension (pg_extension.extnamespace), or InvalidOid if this information
is not available. plpgsql_check embeds a copy of this code when
performing checks on functions, as one out-of-core example.
Author: Pavel Stehule
Reviewed-by: Julien Rouhaud
Discussion: https://postgr.es/m/CAFj8pRD+9x55hjDoi285jCcjPc8uuY_D+FLn5RpXggdz+4O2sQ@mail.gmail.com
-rw-r--r-- | src/backend/commands/extension.c | 2 | ||||
-rw-r--r-- | src/include/commands/extension.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c index b1509cc505d..02ff4a9a7fb 100644 --- a/src/backend/commands/extension.c +++ b/src/backend/commands/extension.c @@ -222,7 +222,7 @@ get_extension_name(Oid ext_oid) * * Returns InvalidOid if no such extension. */ -static Oid +Oid get_extension_schema(Oid ext_oid) { Oid result; diff --git a/src/include/commands/extension.h b/src/include/commands/extension.h index 9f475044916..74ae3913958 100644 --- a/src/include/commands/extension.h +++ b/src/include/commands/extension.h @@ -47,6 +47,7 @@ extern ObjectAddress ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt * extern Oid get_extension_oid(const char *extname, bool missing_ok); extern char *get_extension_name(Oid ext_oid); +extern Oid get_extension_schema(Oid ext_oid); extern bool extension_file_exists(const char *extensionName); extern ObjectAddress AlterExtensionNamespace(const char *extensionName, const char *newschema, |