"create function... depends on extension..." not supported. Why? - Mailing list pgsql-general

From Bryn Llewellyn
Subject "create function... depends on extension..." not supported. Why?
Date
Msg-id B6FB3DAF-08DE-4BC3-8744-3A051DF64280@yugabyte.com
Whole thread Raw
Responses Re: "create function... depends on extension..." not supported. Why?
List pgsql-general
Note: I’m asking because the answer to the question “Why isn’t X supported?” is always useful. For example, if
supportingit would imply a logical impossibility that I’m too slow to spot, it helps me when someone explains what I
failedto 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
existingmental 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$;




pgsql-general by date:

Previous
From: Sam Kidman
Date:
Subject: errcodes.h and others not generated when compiling 13.6 on M1 Mac
Next
From: "David G. Johnston"
Date:
Subject: Re: "create function... depends on extension..." not supported. Why?