Skip to content

Commit 087388d

Browse files
author
Commitfest Bot
committed
[CF 5735] v1 - SQL function to access to creating_extension
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/5735 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/CAG=VW17kAweKGwqtVU8vn71uRCOS9yxnyEnoa=-3sAuyZt5O6g@mail.gmail.com Author(s): Yurii Rashkovskii
2 parents 5092aae + 5cdee20 commit 087388d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/backend/commands/extension.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3928,3 +3928,13 @@ find_in_paths(const char *basename, List *paths)
39283928

39293929
return NULL;
39303930
}
3931+
3932+
Datum
3933+
pg_creating_extension(PG_FUNCTION_ARGS)
3934+
{
3935+
if (creating_extension)
3936+
{
3937+
PG_RETURN_OID(CurrentExtensionObject);
3938+
}
3939+
PG_RETURN_NULL();
3940+
}

src/include/catalog/pg_proc.dat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10757,6 +10757,11 @@
1075710757
proname => 'pg_extension_config_dump', provolatile => 'v', proparallel => 'u',
1075810758
prorettype => 'void', proargtypes => 'regclass text',
1075910759
prosrc => 'pg_extension_config_dump' },
10760+
{ oid => '3814',
10761+
descr => 'determine if an extension is currently being created',
10762+
proname => 'pg_creating_extension', provolatile => 'v', proparallel => 'u',
10763+
prorettype => 'oid', proargtypes => '',
10764+
prosrc => 'pg_creating_extension' },
1076010765

1076110766
# SQL-spec window functions
1076210767
{ oid => '3100', descr => 'row number within partition',

0 commit comments

Comments
 (0)