Re: Catalog version access

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vik Fearing <vik(at)postgresfriends(dot)org>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Catalog version access
Date: 2021-03-03 19:16:43
Message-ID: 1206100.1614799003@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Vik Fearing <vik(at)postgresfriends(dot)org> writes:
> On 3/3/21 6:35 PM, Peter Eisentraut wrote:
>> If what you want to know is whether a given binary can run against a
>> given data directory then CATALOG_VERSION_NO isn't the only thing you
>> need to check.  The full truth of this is in ReadControlFile().  The
>> best way to get that answer is to start a server and see if it
>> complains.  You can even grep the log for "It looks like you need to
>> initdb.".

> In that case, what would everyone think about a `pg_ctl check` option?

The trouble with Peter's recipe is that it doesn't work if there is
already a server instance running there (or at least I think we'll
bitch about the existing postmaster first, maybe I'm wrong). Now,
that's not such a big problem for the use-case you were describing.
But I bet if we expose this method as an apparently-general-purpose
pg_ctl option, there'll be complaints.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2021-03-03 19:43:20 Re: Extensibility of the PostgreSQL wire protocol
Previous Message Tom Lane 2021-03-03 18:54:18 Re: Libpq support to connect to standby server as priority