public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH] Advise devs to prefer server_version_num over parsing the version
2+ messages / 2 participants
[nested] [flat]

* [PATCH] Advise devs to prefer server_version_num over parsing the version
@ 2015-02-06 05:52 Craig Ringer <[email protected]>
  2015-04-29 00:31 ` Re: [PATCH] Advise devs to prefer server_version_num over parsing the version Bruce Momjian <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Craig Ringer @ 2015-02-06 05:52 UTC (permalink / raw)
  To: pgsql-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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [PATCH] Advise devs to prefer server_version_num over parsing the version
  2015-02-06 05:52 [PATCH] Advise devs to prefer server_version_num over parsing the version Craig Ringer <[email protected]>
@ 2015-04-29 00:31 ` Bruce Momjian <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Bruce Momjian @ 2015-04-29 00:31 UTC (permalink / raw)
  To: Craig Ringer <[email protected]>; +Cc: pgsql-docs

On Fri, Feb  6, 2015 at 04:52:54PM +1100, Craig Ringer wrote:
> We've had server_version_num since 8.2.
> 
> Advise devs to prefer to use it instead of parsing version() or server_version

Patch applied.

-- 
  Bruce Momjian  <[email protected]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2015-04-29 00:31 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-02-06 05:52 [PATCH] Advise devs to prefer server_version_num over parsing the version Craig Ringer <[email protected]>
2015-04-29 00:31 ` Bruce Momjian <[email protected]>

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