Re: select version() with internal number version?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Wèi Cōngruì <crvv(dot)mail(at)gmail(dot)com>
Cc: fluca1978(at)gmail(dot)com, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: select version() with internal number version?
Date: 2018-08-09 13:51:51
Message-ID: 26144.1533822711@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?UTF-8?B?V8OoaSBDxY1uZ3J1w6w=?= <crvv(dot)mail(at)gmail(dot)com> writes:
> On Thu, Aug 9, 2018 at 3:01 PM Luca Ferrari <fluca1978(at)gmail(dot)com> wrote:
>> Is there any way to get directly the PostgreSQL version number?

> SHOW server_version;
> SHOW server_version_num;

Also, if you're using libpq, see PQserverVersion() which
(a) avoids a round trip to the server, and (b) works further back
than server_version_num, though that issue is probably academic
to most folk at this point (server_version_num appeared in 8.2).

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2018-08-09 16:11:48 Re: found xmin from before relfrozenxid on pg_catalog.pg_authid
Previous Message hmidi slim 2018-08-09 10:50:56 postgresql-10-pldebugger in alpine linux distribution