Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Cc: tgl@sss.pgh.pa.us, pavel.stehule@gmail.com, a.zakirov@postgrespro.ru, michael.paquier@gmail.com, pgsql-hackers@postgresql.org
Date: 2018-03-16T01:25:35Z
Lists: 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
Commits
-
Prevent extensions from creating custom GUCs that are GUC_LIST_QUOTE.
- 846b5a525746 11.0 landed
-
Fix mishandling of quoted-list GUC values in pg_dump and ruleutils.c.
- be677bb5aa79 9.3.23 landed
- a35d72923165 9.5.13 landed
- 8132f0f3856d 9.6.9 landed
- 742869946f4f 11.0 landed
- 67e02cde7373 9.4.18 landed
- 66e92878aaec 10.4 landed