From: Bryn Llewellyn <bryn@yugabyte.com>
To: pgsql-general list <pgsql-general@lists.postgresql.org>
Subject: "create function... depends on extension..." not supported. Why?
Date: Tue, 26 Apr 2022 17:22:12 -0700
Message-ID: <B6FB3DAF-08DE-4BC3-8744-3A051DF64280@yugabyte.com> (raw)
Note: I’m asking because the answer to the question “Why isn’t X supported?” is always useful. For example, if supporting it would imply a logical impossibility that I’m too slow to spot, it helps me when someone explains what I failed to realize. Equally, it helps me to know when the answer is “It’s just a historical accident. It could have been supported. But, now that it isn’t, it doesn’t seem worth the effort to bridge that gap” because this shows me that my existing mental model is sound.
The background for my question here is that among the documented changes that you can make using “alter function”
https://www.postgresql.org/docs/current/sql-alterfunction.html
you can specify all of them at “create time” too (but possibly, like “owner”, only implicitly) except for “depends on extension”. When you know in advance that you want to set this property, you need two statements:
create function f()
returns int
language plpgsql
as $body$
begin
return 42;
end;
$body$;
alter function f()
depends on extension pgcrypto;
Why is this not supported:
create function f()
returns int
language plpgsql
depends on extension pgcrypto
as $body$
begin
return 42;
end;
$body$;
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: bryn@yugabyte.com
Subject: Re: "create function... depends on extension..." not supported. Why?
In-Reply-To: <B6FB3DAF-08DE-4BC3-8744-3A051DF64280@yugabyte.com>
References: <B6FB3DAF-08DE-4BC3-8744-3A051DF64280@yugabyte.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox