X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id D6DA09DC831 for ; Sat, 11 Feb 2006 12:03:41 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 44931-06 for ; Sat, 11 Feb 2006 12:03:35 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by postgresql.org (Postfix) with ESMTP id F1F6D9DC839 for ; Sat, 11 Feb 2006 12:03:34 -0400 (AST) Received: from [84.173.7.15] (helo=[192.168.1.10]) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis), id 0ML21M-1F7xDe0oUT-0006qn; Sat, 11 Feb 2006 17:03:30 +0100 Message-ID: <43EE0AD2.1050701@online.de> Date: Sat, 11 Feb 2006 17:03:30 +0100 From: Christoph Zwerschke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041206 Thunderbird/1.0 Mnenhy/0.6.0.104 MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: Re: Finding the pqlib version References: <200602111501.k1BF1i017587@candle.pha.pa.us> In-Reply-To: <200602111501.k1BF1i017587@candle.pha.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de login:d4c19f41f9a9703255691874c1441822 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.068 required=5 tests=[AWL=0.068] X-Spam-Score: 0.068 X-Spam-Level: X-Archive-Number: 200602/29 X-Sequence-Number: 5993 Bruce Momjian wrote: > You want the server version. In PostgreSQL 8.0 and later you can use > libpq's PQserverVersion(), but for pre-8.0, I think you have to do > SELECT version(), and parse that: I'd prefer something defined in the Postgres include files that can be checked by the precompiler already. In Python, the version information with major, minor and micro is defined in patchlevel.h and can be used for conditional compilation. It would be nice if something like this existed also for Postgres. I noticed pg_config.h has PG_VERSION, but it is the compound version of major, minor and micro including the dots which cannot be easily compared. -- Christoph