On 2022-06-14 Tu 12:20, Tom Lane wrote: > Andrew Dunstan <and...@dunslane.net> writes: >> The first makes the argument for $node->config_data() optional. If it's >> not supplied, pg_config is called without an argument and the whole >> result is returned. Currently, if you try that you get back a nasty and >> cryptic error. > No opinion about whether that's useful. > >> The second changes the new GUCs TAP test to check against the installed >> postgresql.conf.sample rather than the one in the original source >> location. There are probably arguments both ways, but if we ever decided >> to postprocess the file before installation, this would do the right thing. > Seems like a good idea, especially since it also makes the test code > shorter and more robust(-looking). > > Looking at the patch itself, > > +my $share_dir = $node->config_data('--sharedir'); > +chomp $share_dir; > +$share_dir =~ s/^SHAREDIR = //; > +my $sample_file = "$share_dir/postgresql.conf.sample"; > > I kind of wonder why config_data() isn't doing the chomp itself; > what caller would not want that? Pulling off the variable name > might be helpful too, since it's hard to conceive of a use-case > where you don't also need that.
It already chomps the output, and pg_config doesn't output "SETTING = " if given an option argument, so we could just remove those two lines - they are remnants of an earlier version. I'll do it that way. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com