select version() with internal number version?

From: Luca Ferrari <fluca1978(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: select version() with internal number version?
Date: 2018-08-09 07:00:25
Message-ID: CAKoxK+6h4wsGUVV2AW8mbhsSoy+-=LheYeYLNLQTMFCkz5Ku_A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Wèi Cōngruì 2018-08-09 07:10:02 Re: select version() with internal number version?
Previous Message Abhinav Mehta 2018-08-08 17:54:45 Re: Pg_rewind cannot load history wal