On Oct 14, 2008, at 14:50, Hannu Krosing wrote:

Was current_setting('server_version') available in 8.1 ?

Yes. In 8.0, too.

There must be a way to get string_to_array() to evaluate only once, yes?

SELECT s.a[1]::int * 10000 + s.a[2]::int * 100 + s.a[3]::int
FROM
(SELECT string_to_array(current_setting('server_version'), '.') AS a)
AS s;

Oh, duh. Even better!

Best,

David


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to