Re: PG minor version in data directory?

From: "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: PG minor version in data directory?
Date: 2023-08-19 09:14:22
Message-ID: 20230819091422.ivqyk22fmiu7folp@hjp.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2023-08-19 14:22:25 +1000, Justin Clift wrote:
> On 2023-08-19 14:10, David G. Johnston wrote:
> > On Fri, Aug 18, 2023 at 6:36 PM Justin Clift <justin(at)postgresql(dot)org>
> > wrote:
> >
> > > If the minor version is already tracked somewhere as well, that
> > > would be extremely useful for my use case.
> > >
> > >
> > The data directory doesn't have a concept of "minor version". Only the
> > installed libraries and binaries do.
>
> Thanks, that's what I figured. I'll have to keep state in a
> PG_VERSION_MINOR
> there or something. :)

Wouldn't it be better to ask whatever system you use to install the
software for the version?

E.g. on Debian derived Linuux distributions:

% dpkg -l postgresql-14
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-=====================-============-=========================================================
ii postgresql-14 14.9-0ubuntu0.22.04.1 amd64 The World's Most Advanced Open Source Relational Database

or

% apt policy postgresql-14
postgresql-14:
Installed: 14.9-0ubuntu0.22.04.1
Candidate: 14.9-0ubuntu0.22.04.1
Version table:
*** 14.9-0ubuntu0.22.04.1 500
500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
100 /var/lib/dpkg/status
14.2-1ubuntu1 500
500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages

If you compile the software yourself, you could always ask postgres:

% /usr/lib/postgresql/14/bin/postgres --version
postgres (PostgreSQL) 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1)

hp

--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp(at)hjp(dot)at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Siddharth Karandikar 2023-08-19 11:26:25 Failing to compile with ICU support error on Ubuntu
Previous Message M4X 2023-08-19 07:25:29 case and accent insensitive search under Python ?