On Mon, Jan 24, 2022 at 07:07:29PM -0600, Justin Pryzby wrote: > I think you'll find that this is how it's done elsewhere in postgres. > In the frontend, see appendPQExpBufferChar and appendPGArray and 3e6e86abc. > On the backend, see: git grep -F "'{'" |grep -w appendStringInfoChar
Yeah, I was not careful enough to look after the uses of TEXTARRAYOID, and there is one in the same area, as of config_enum_get_options(). At least things are consistent this way. > I updated the patch with a regex to accommodate GUCs without '=', as needed > since f47ed79cc8. Okay. While looking at your proposal, I was thinking that we had better include the array with the flags by default in pg_settings, and not just pg_show_all_settings(). +SELECT lower(name) FROM pg_settings_flags WHERE NOT not_in_sample EXCEPT +SELECT regexp_replace(ln, '^#?([_[:alpha:]]+) (= .*|[^ ]*$)', '\1') AS guc +FROM (SELECT regexp_split_to_table(pg_read_file('postgresql.conf'), '\n') AS ln) conf Tests reading postgresql.conf would break on instances started with a custom config_file provided by a command line, no? You could change the patch to use the value provided by the GUC, instead, but I am not convinced that we need that at all, even if check_guc does so. Regarding the tests, I am not sure if we need to be this much extensive. We could take is slow, and I am also wondering if this could not cause some issues with GUCs loaded via shared_preload_libraries if we are too picky about the requirements, as this could cause installcheck failures. The following things have been issues recently, though, and they look sensible enough to have checks for: - GUC_NOT_IN_SAMPLE with developer options. - Query-tuning parameters with GUC_EXPLAIN, and we'd better add some comments in the test to explain why there are exceptions like default_statistics_target. - preset parameters marked as runtime-computed. - NO_SHOW_ALL and NOT_IN_SAMPLE. Thanks, -- Michael
signature.asc
Description: PGP signature