> On Mar 30, 2021, at 5:52 PM, Michael Paquier <michael@paquier.xyz> wrote:
>
> On Tue, Mar 30, 2021 at 08:44:26PM -0400, Andrew Dunstan wrote:
>> Yeah, it should be validated. All things considered I think just calling
>> 'pg_config --version' is probably the simplest validation, and likely to
>> be sufficient.
>>
>> I'll try to come up with something tomorrow.
>
> There is already TestLib::check_pg_config(). Shouldn't you leverage
> that with PG_VERSION_NUM or equivalent?
Only if you change that function. It doesn't currently do anything special to run the *right* pg_config.
The patch I sent takes the view that once the install_path has been sanity checked and the *right* pg_config executed,
relyingon the environment's path variables thereafter is safe. But that means the initial pg_config execution is
uniquein not being able to rely on the path. There really isn't enough motivation for changing TestLib, I don't think,
becausesubsequent calls to pg_config don't need to be paranoid, just the first call.
—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company