Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C98714764ED for ; Mon, 9 Dec 2002 18:58:10 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id EFBD7476696 for ; Mon, 9 Dec 2002 18:47:32 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id gB9NlUpd020820; Mon, 9 Dec 2002 18:47:30 -0500 (EST) To: Ian Barwick Cc: dbi-dev@perl.org, pgsql-interfaces@postgresql.org Subject: Re: Patch for DBD::Pg pg_relcheck problem In-reply-to: <200212100034.31936.barwick@gmx.net> References: <200212091631.00125.barwick@gmx.net> <8159.1039449832@sss.pgh.pa.us> <200212100034.31936.barwick@gmx.net> Comments: In-reply-to Ian Barwick message dated "Tue, 10 Dec 2002 00:34:31 +0100" Date: Mon, 09 Dec 2002 18:47:30 -0500 Message-ID: <20819.1039477650@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/24 X-Sequence-Number: 3437 Ian Barwick writes: > So out with the candle wax and pins ;-). Am I right > in thinking that the string returned by SELECT version() > starts with the word "PostgreSQL" followed by: > a space; > a single digit indicating the major version number; > a full stop / decimal point; > a single digit indicating the minor version number; > and either "interim release" number (e.g. ".1" in the case of 7.3.1), or > "devel", "rc1" etc. ? I would recommend parsing it the same way pg_dump does, see _check_database_version(). Looks like it's basically skip-11-chars- and-sscanf. Note the lack of assumptions about numbers of digits. In the next protocol version update (hopefully 7.4) I would like to see the basic version string (eg, "7.3.1" or "7.4devel") delivered to the client automatically during connection startup and then available from a libpq inquiry function. This would eliminate the need to call version() explicitly and to know that you must skip "PostgreSQL " in its output. However, it will only help for clients/libraries that are willing to deal exclusively with 7.4-or-newer backends, so it will take a few releases to become really useful. regards, tom lane