Re: phpinfo(): postgresql versions' mismatch

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Mihail Mihailov <Mihail(dot)Mihailov(at)uta(dot)fi>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: phpinfo(): postgresql versions' mismatch
Date: 2007-02-12 03:13:52
Message-ID: 20070212031352.GA11669@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

On Fri, Feb 09, 2007 at 07:53:46PM +0200, Mihail Mihailov wrote:
> > Only some PHP queries don't run? What's different about those that
> > run and those that don't?
>
> At first everything seemed to work fine. Connection works, queries run.
> So far I have found only one query, which worked in postgres 7.4 and
> doesn't seem to work now. It is a SELECT query with LIMIT and OFFSET
> clauses.
> The first query with OFFSET 0 worked, but the second with OFFSET N
> returned an empty recordset.
> I suspected that it has to do with php because the same query works
> fine in psql environment.

Have you turned on statement logging in the database to verify that
PHP is sending the query you think it is? Have you looked for
errors in the database logs? What does the PHP code that fetches
the results look like?

> Actually, these queries do not fail they just don't return any data.
> Do you think it's more likely a bug in the script?

Impossible to say without more information. A self-contained test
case might be useful.

> > 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.
>
> So, you think it is not a good idea to make php use the 8.x libpq?

I didn't mean to suggest not using libpq 8.x; I was suggesting that
you review your queries to make sure you're not depending on implicit
type casts that PDO's emulated prepared statements might be making
that will no longer be made with the "real" prepared statements
that PDO uses when linked against libpq 8.x.

--
Michael Fuhr

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Mihail Mihailov 2007-02-12 06:58:49 Re: phpinfo(): postgresql versions' mismatch
Previous Message ljb 2007-02-10 01:51:45 Re: phpinfo(): postgresql versions' mismatch