Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 9B7BC9FA22A for ; Fri, 9 Feb 2007 10:57:41 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 15820-06 for ; Fri, 9 Feb 2007 10:57:32 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 745559F9EF4 for ; Fri, 9 Feb 2007 10:57:37 -0400 (AST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.8/8.13.8) with ESMTP id l19EvVkR008937 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 9 Feb 2007 07:57:34 -0700 (MST) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.8/8.13.8) with ESMTP id l19EvVdv029130; Fri, 9 Feb 2007 07:57:31 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.8/8.13.8/Submit) id l19EvVwA029129; Fri, 9 Feb 2007 07:57:31 -0700 (MST) (envelope-from mfuhr) Date: Fri, 9 Feb 2007 07:57:31 -0700 From: Michael Fuhr To: Mihail Mihailov Cc: pgsql-php@postgresql.org Subject: Re: phpinfo(): postgresql versions' mismatch Message-ID: <20070209145731.GA28879@winnie.fuhr.org> References: <20070209113129.he36qgs4vthc0o4c@imp3.uta.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070209113129.he36qgs4vthc0o4c@imp3.uta.fi> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/17 X-Sequence-Number: 3700 On Fri, Feb 09, 2007 at 11:31:29AM +0200, Mihail Mihailov wrote: > I have recently found out that PHP libpq Version reported by > phpinfo() doesn't match the Actual PGSQL Version on the server. > I suspect this is the reason why some of postgresql queries do not run > via web interface and run without any problem via psql. Only some PHP queries don't run? What's different about those that run and those that don't? Do the queries that don't run fail with an error message? If so, what's the exact message? What do the PostgreSQL logs show for the failed queries? You might need to adjust settings like log_min_error_statement in postgresql.conf to get useful log entries. If you ever upgrade PHP to use 8.x libraries instead of 7.4 libraries, beware that some prepared queries that used to work might start failing. I've seen that happen because PDO emulates prepared queries when linked against 7.4 and uses real prepared queries when linked against 8.x (on Unix-like platforms anyway; I think PDO still emulates prepared queries Windows). The problems arose when the emulated queries made implicit type casts that were no longer made with the real prepared queries. A specific example I saw involved casting a boolean value to an integer: the emulated prepared query converted true and false to 1 and 0, respectively, but the real prepared query passed 't' and 'f' to the backend, which rejected the query with a syntax error because 't' and 'f' aren't integers. -- Michael Fuhr