On Fri, Mar 16, 2018 at 10:25:35AM +0900, Michael Paquier wrote: >> But, I suppose it is a bit too big. > > That's of course not backpatchable.
So in this jungle attached is my counter-proposal. As the same code pattern is repeated in three places, we could as well refactor the whole into a common routine, say in src/common/guc_options.c or similar. Perhaps just on HEAD and not back-branches as this is always annoying for packagers on Windows using custom scripts. Per the lack of complains only doing something on HEAD, with only a subset of the parameters which make sense for CREATE FUNCTION is what makes the most sense in my opinion.
Last patch is good enough solution, I tested it and it is working
Little bit strange is support of GUC, that cannot be atteched to any fx. Probably only PGC_USERSET, maybe PGC_SUSET has sense there
another idea, how to solve this issue for extensions. The information about format of extensions GUC can be stored in new column pg_extension - maybe just a array of list of LIST GUC.