Re: select version() with internal number version?

From: Wèi Cōngruì <crvv(dot)mail(at)gmail(dot)com>
To: fluca1978(at)gmail(dot)com
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: select version() with internal number version?
Date: 2018-08-09 07:10:02
Message-ID: CAPxZtjHBtqVrcumktoxgS9acqshsM8NxVNPc7Tjm2E+oFCH4pw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

SHOW server_version;
SHOW server_version_num;

I can fetch the version by these two statement.

On Thu, Aug 9, 2018 at 3:01 PM Luca Ferrari <fluca1978(at)gmail(dot)com> wrote:

> HI all,
> I see a lot of external tools that do a 'SELECT version()' and then
> parse the output to get the version number (e.g., 10.4).
> My opinion is that this is not a good approach, since the output of
> version includes a lot of information and can mismatch a poorly
> written regular expression. It would be better to use pg_config
> --version, byt again there is the needing for mangling the data.
> Is there any way to get directly the PostgreSQL version number?
>
> Thanks,
> Luca
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hmidi slim 2018-08-09 10:50:56 postgresql-10-pldebugger in alpine linux distribution
Previous Message Luca Ferrari 2018-08-09 07:00:25 select version() with internal number version?