pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedPG minor version in data directory?
5+ messages / 3 participants
[nested] [flat]
* PG minor version in data directory?
@ 2023-08-19 01:36 Justin Clift <justin@postgresql.org>
2023-08-19 04:10 ` Re: PG minor version in data directory? David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Justin Clift @ 2023-08-19 01:36 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
Hiyas,
Anyone know if there's a good way to tell what *minor* version
of PostgreSQL a data directory has been run with?
eg 15.3 vs 15.4
Am working on some "automatic upgrade" stuff, and I'm only aware
of the major version being tracked in PGDATA/PG_VERSION.
If the minor version is already tracked somewhere as well, that
would be extremely useful for my use case.
Otherwise, I'll have to start manually adding info to track it.
Regards and best wishes,
Justin Clift
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: PG minor version in data directory?
2023-08-19 01:36 PG minor version in data directory? Justin Clift <justin@postgresql.org>
@ 2023-08-19 04:10 ` David G. Johnston <david.g.johnston@gmail.com>
2023-08-19 04:22 ` Re: PG minor version in data directory? Justin Clift <justin@postgresql.org>
0 siblings, 1 reply; 5+ messages in thread
From: David G. Johnston @ 2023-08-19 04:10 UTC (permalink / raw)
To: Justin Clift <justin@postgresql.org>; +Cc: pgsql-general@lists.postgresql.org
On Fri, Aug 18, 2023 at 6:36 PM Justin Clift <justin@postgresql.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.
David J.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: PG minor version in data directory?
2023-08-19 01:36 PG minor version in data directory? Justin Clift <justin@postgresql.org>
2023-08-19 04:10 ` Re: PG minor version in data directory? David G. Johnston <david.g.johnston@gmail.com>
@ 2023-08-19 04:22 ` Justin Clift <justin@postgresql.org>
2023-08-19 09:14 ` Re: PG minor version in data directory? Peter J. Holzer <hjp-pgsql@hjp.at>
0 siblings, 1 reply; 5+ messages in thread
From: Justin Clift @ 2023-08-19 04:22 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: pgsql-general@lists.postgresql.org
On 2023-08-19 14:10, David G. Johnston wrote:
> On Fri, Aug 18, 2023 at 6:36 PM Justin Clift <justin@postgresql.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. :)
Regards and best wishes,
Justin Clift
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: PG minor version in data directory?
2023-08-19 01:36 PG minor version in data directory? Justin Clift <justin@postgresql.org>
2023-08-19 04:10 ` Re: PG minor version in data directory? David G. Johnston <david.g.johnston@gmail.com>
2023-08-19 04:22 ` Re: PG minor version in data directory? Justin Clift <justin@postgresql.org>
@ 2023-08-19 09:14 ` Peter J. Holzer <hjp-pgsql@hjp.at>
2023-08-19 18:04 ` Re: PG minor version in data directory? Justin Clift <justin@postgresql.org>
0 siblings, 1 reply; 5+ messages in thread
From: Peter J. Holzer @ 2023-08-19 09:14 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
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@postgresql.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@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"
Attachments:
signature.asc (application/pgp-signature, 832B) download
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: PG minor version in data directory?
2023-08-19 01:36 PG minor version in data directory? Justin Clift <justin@postgresql.org>
2023-08-19 04:10 ` Re: PG minor version in data directory? David G. Johnston <david.g.johnston@gmail.com>
2023-08-19 04:22 ` Re: PG minor version in data directory? Justin Clift <justin@postgresql.org>
2023-08-19 09:14 ` Re: PG minor version in data directory? Peter J. Holzer <hjp-pgsql@hjp.at>
@ 2023-08-19 18:04 ` Justin Clift <justin@postgresql.org>
0 siblings, 0 replies; 5+ messages in thread
From: Justin Clift @ 2023-08-19 18:04 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On 2023-08-19 19:14, Peter J. Holzer wrote:
> On 2023-08-19 14:22:25 +1000, Justin Clift wrote:
<snip>
>> 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?
In the general sense, yes. :)
For the very specific use case I'm working with (!), things are a bit
different. It's for this, if that helps with context:
* https://github.com/pgautoupgrade/docker-pgautoupgrade
* https://hub.docker.com/r/pgautoupgrade/pgautoupgrade <-- docker
repo
It's a docker container that people use for running PostgreSQL, but
also has the ability to (automatically) upgrade the data files from
older versions. That's the piece I'm working on.
Such a thing is useful for people that need a PG docker container,
and whose needs are fairly simple. They can use point at this one,
and they'll have a self-upgrading PG version that's fairly "fire and
forget".
Thus far (1 month in), it seems to work ok (for us) and some other
people.
Am obviously looking to improve its capabilities over time too. :)
+ Justin
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2023-08-19 18:04 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-08-19 01:36 PG minor version in data directory? Justin Clift <justin@postgresql.org>
2023-08-19 04:10 ` David G. Johnston <david.g.johnston@gmail.com>
2023-08-19 04:22 ` Justin Clift <justin@postgresql.org>
2023-08-19 09:14 ` Peter J. Holzer <hjp-pgsql@hjp.at>
2023-08-19 18:04 ` Justin Clift <justin@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox