Re: Determine server version from psql script

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Igor Korot <ikorot01(at)gmail(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Determine server version from psql script
Date: 2025-03-23 00:59:11
Message-ID: 460947.1742691551@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> writes:
> On 3/22/25 17:31, Igor Korot wrote:
>> Is there a way to determine the server version from such a script?

> show server_version_num;

psql already populates its SERVER_VERSION_NUM variable from that
for you.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2025-03-23 01:04:19 Re: query_id: jumble names of temp tables for better pg_stat_statement UX
Previous Message Michael Paquier 2025-03-23 00:47:31 Re: query_id: jumble names of temp tables for better pg_stat_statement UX