Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs
Дата
Msg-id 20180316012535.GE2666@paquier.xyz
обсуждение исходный текст
Ответ на Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Ответы Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On Thu, Mar 15, 2018 at 06:48:36PM +0900, Kyotaro HORIGUCHI wrote:
> postgres=# CREATE FUNCTION func_with_set_params() RETURNS integer
>     AS 'select 1;'
>     LANGUAGE SQL
>     set plpgsql.extra_errors to 'shadowed_variables'
>     set work_mem to '48MB'
>     set plpgsql.extra_warnings to 'shadowed_variables';
> ERROR:  the module for variable "plpgsql.extra_errors" is not loaded yet
> DETAIL:  The module must be loaded before referring this variable.

How can you be sure that a parameter actually exists?  A function
definition could as well use a parameter which does not exist, but you
would get this error as well, no?  I find that error and handling a bit
confusing.

> postgres=# load 'plpgsql';
> [...]
> pg_get_functiondef() can work correctly with this even if
> required modules are not loaded.

Yeah, but the neck to any approaches here is that many applications may
rely on the existing behavior, and would miss the fact that they need to
load a module manually.

> But, I suppose it is a bit too big.

That's of course not backpatchable.
--
Michael

Вложения

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: User defined data types in Logical Replication
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: [HACKERS] plpgsql - additional extra checks