pg_get_functiondef and aggregate functions

Поиск
Список
Период
Сортировка
От Erki Eessaar
Тема pg_get_functiondef and aggregate functions
Дата
Msg-id AM9PR01MB8268B43E248FE1DE03E1A970FE8C9@AM9PR01MB8268.eurprd01.prod.exchangelabs.com
обсуждение исходный текст
Список pgsql-bugs
Hello

In my opinion it is confusing that although in terms of the system catalog an aggregate function is a function
the function pg_get_functiondef does not work in case of aggregate functions and produces an error.

The following code was tested in PostgreSQL 14.

SELECT pg_get_functiondef(oid) AS aggregate_function
FROM pg_proc
WHERE prokind='a';

ERROR:  "array_agg" is an aggregate function

The same happens in PostgreSQL 10.

SELECT pg_get_functiondef(oid) AS aggregate_function
FROM pg_proc
WHERE proisagg=TRUE;

At the same time the routine for returning information about parameters works with aggregate functions.

SELECT pg_get_function_arguments(oid) AS aggregate_function
FROM pg_proc
WHERE prokind='a';

I suggest that it should be at least mentioned in the documentation.

Best regards
Erki Eessaar

В списке pgsql-bugs по дате отправления: