Re: Get PG primary version without substring manipulation?

From: J T <jorge(dot)torralba(at)gmail(dot)com>
To: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Get PG primary version without substring manipulation?
Date: 2024-06-13 16:50:03
Message-ID: CACut7uQP7VVOcfqQ92QnE+UsraM_8eM0=s1UyDFyhb_g0jYvaw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Don't forget ...

cat /datadirectory/PG_VERSION

JT

On Thu, Jun 13, 2024 at 5:52 AM Ron Johnson <ronljohnsonjr(at)gmail(dot)com> wrote:

> cut, awk, head, bash, etc are easy enough, but am I overlooking some
> intrinsic method of getting just PG's primary version number (9.6 or 14, in
> my case) without doing substring manipulation?
>
> $ ssh foo.example.com pg_config --version
> PostgreSQL 9.6.24
> $ ssh foo.example.com psql --version
> psql (PostgreSQL) 9.6.24
> $ psql -h foo.example.com -Xtc "SELECT version();"
> PostgreSQL 9.6.24 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5
> 20150623 (Red Hat 4.8.5-44), 64-bit
>
> $ ssh bar.example.com pg_config --version
> PostgreSQL 14.12
> $ ssh bar.example.com psql --version
> psql (PostgreSQL) 14.12
> $ psql -h bar.example.com -Xtc "SELECT version();"
> PostgreSQL 14.12 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0
> 20210514 (Red Hat 8.5.0-20), 64-bit
>
>

--
Thanks,

Jorge Torralba
----------------------------

Note: This communication may contain privileged or other confidential
information. If you are not the intended recipient, please do not print,
copy, retransmit, disseminate or otherwise use the information. Please
indicate to the sender that you have received this email in error and
delete the copy you received. Thank You.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ian Lawrence Barwick 2024-06-14 00:30:59 Re: Get PG primary version without substring manipulation?
Previous Message David Mitchell 2024-06-13 14:02:22 Re: How to Handle Sequences in Logical Bi-Directional Replication