"create function... depends on extension..." not supported. Why?

From: Bryn Llewellyn <bryn(at)yugabyte(dot)com>
To: pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: "create function... depends on extension..." not supported. Why?
Date: 2022-04-27 00:22:12
Message-ID: B6FB3DAF-08DE-4BC3-8744-3A051DF64280@yugabyte.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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$;

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2022-04-27 00:44:14 Re: "create function... depends on extension..." not supported. Why?
Previous Message Sam Kidman 2022-04-27 00:05:30 errcodes.h and others not generated when compiling 13.6 on M1 Mac