public inbox for [email protected]  
help / color / mirror / Atom feed
From: Craig Ringer <[email protected]>
To: [email protected]
Subject: [PATCH] Advise devs to prefer server_version_num over parsing the version
Date: Fri, 6 Feb 2015 16:52:54 +1100
Message-ID: <CAMsr+YFe+2jQaavMYa5ULzZv4B_M=SOJB8uavbEmKqpUt5H8uw@mail.gmail.com> (raw)
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-docs>

We've had server_version_num since 8.2.

Advise devs to prefer to use it instead of parsing version() or
server_version .

-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs


Attachments:

  [text/x-patch] 0001-Advise-devs-to-use-server_version_num.patch (1.6K, 3-0001-Advise-devs-to-use-server_version_num.patch)
  download | inline diff:
From db8b82c54e492312c3dc6d908179075338961adf Mon Sep 17 00:00:00 2001
From: Craig Ringer <[email protected]>
Date: Fri, 6 Feb 2015 16:49:53 +1100
Subject: [PATCH] Advise devs to use server_version_num

---
 doc/src/sgml/func.sgml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 6d4f331..0d76f9f 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -14449,7 +14449,7 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
       <row>
        <entry><literal><function>version()</function></literal></entry>
        <entry><type>text</type></entry>
-       <entry><productname>PostgreSQL</> version information</entry>
+       <entry><productname>PostgreSQL</> version information. See also <xref linkend="guc-server-version-num"> for a machine-readable version.</entry>
       </row>
      </tbody>
     </tgroup>
@@ -14636,7 +14636,12 @@ SET search_path TO <replaceable>schema</> <optional>, <replaceable>schema</>, ..
 
    <para>
     <function>version</function> returns a string describing the
-    <productname>PostgreSQL</productname> server's version.
+    <productname>PostgreSQL</productname> server's version. You can also
+    get this information from <xref linkend="guc-server-version"> or
+    for a machine-readable version, <xref linkend="guc-server-version-num">.
+    Software developers should use <literal>server_version_num</literal>
+    (available since 8.2) or <xref linkend="libpq-pqserverversion"> instead
+    of parsing the text version.
    </para>
 
   <indexterm>
-- 
2.1.0



view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [PATCH] Advise devs to prefer server_version_num over parsing the version
  In-Reply-To: <CAMsr+YFe+2jQaavMYa5ULzZv4B_M=SOJB8uavbEmKqpUt5H8uw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox