Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Cc: michael@paquier.xyz, pavel.stehule@gmail.com, a.zakirov@postgrespro.ru,
pgsql-hackers@postgresql.org
Date: 2018-03-20T17:27:35Z
Lists: pgsql-hackers
Attachments
- 0001-handle-core-quoted-variables-correctly.patch (text/x-diff) patch 0001
- 0002-reject-extension-quoted-variables.patch (text/x-diff) patch 0002
So here's what I think we should do about this: 1. Only GUC_LIST_QUOTE variables need to be special-cased. It works fine to treat plain LIST variables (e.g. datestyle) with the regular code path. This is good because there are so few of them. 2. We should make an effort to minimize the number of places that know explicitly which variables are GUC_LIST_QUOTE. In the backend, the right thing to do is ask guc.c. In pg_dump, there's no convenient way to ask the backend (and certainly nothing that would work against old servers), but we should at least make sure there's only one place to fix not two. 3. We need to prevent extensions from trying to create GUC_LIST_QUOTE variables, because those are not going to work correctly if they're set before the extension is loaded, nor is there any hope of pg_dump dumping them correctly. The attached 0001 patch does the first two things, and could be back-patched. The 0002 patch, which I'd only propose for HEAD, is one way we could address point 3. A different way would be to throw a WARNING rather than ERROR and then just mask off the problematic bit. Or we could decide that either of these cures is worse than the disease, but I don't really agree with that. Comments? regards, tom lane
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