From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Small TAP improvements |
Date: | 2022-06-14 16:20:56 |
Message-ID: | 78241.1655223656@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Andrew Dunstan <andrew(at)dunslane(dot)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.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2022-06-14 16:26:05 | Re: better page-level checksums |
Previous Message | Peter Geoghegan | 2022-06-14 16:10:03 | Re: better page-level checksums |