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

Поиск
Список
Период
Сортировка
От Bryn Llewellyn
Тема "create function... depends on extension..." not supported. Why?
Дата
Msg-id B6FB3DAF-08DE-4BC3-8744-3A051DF64280@yugabyte.com
обсуждение исходный текст
Ответы Re: "create function... depends on extension..." not supported. Why?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Sam Kidman
Дата:
Сообщение: errcodes.h and others not generated when compiling 13.6 on M1 Mac
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: "create function... depends on extension..." not supported. Why?