pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Mihail Mihailov <Mihail.Mihailov@uta.fi>
Cc: pgsql-php@postgresql.org
Subject: Re: phpinfo(): postgresql versions' mismatch
Date: Fri, 9 Feb 2007 07:57:31 -0700
Message-ID: <20070209145731.GA28879@winnie.fuhr.org> (raw)
In-Reply-To: <20070209113129.he36qgs4vthc0o4c@imp3.uta.fi>
References: <20070209113129.he36qgs4vthc0o4c@imp3.uta.fi>

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



view thread (6+ messages)  latest in thread

Message-ID: <20070209145731.GA28879@winnie.fuhr.org>
Permalink:  ../20070209145731.GA28879@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20070209145731.GA28879@winnie.fuhr.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: mike@fuhr.org, Mihail.Mihailov@uta.fi
  Subject: Re: phpinfo(): postgresql versions' mismatch
  In-Reply-To: <20070209145731.GA28879@winnie.fuhr.org>
  References: <20070209113129.he36qgs4vthc0o4c@imp3.uta.fi> <20070209145731.GA28879@winnie.fuhr.org>

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

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