I recently installed Drupal on Debian unstable, using Apache 1.3 and PostgreSQL. Upon loading the first page I get this error:

warning: pg_exec() query failed: ERROR: LIMIT #,# syntax not supported.
Use separate LIMIT and OFFSET clauses.
in /usr/share/pear/DB/pgsql.php on line 171.

It also appears on every other page I try to load, any ideas on how to fix this?


Dries’s picture

This is a problem with PEAR; the PostgreSQL backend doesn't support the new syntax (but will work with older versions of PostgreSQL). I had to modify /usr/share/pear/DB/pgsql.php to make this work. Maybe check with the Debian and/or PEAR people as this isn't a Drupal issue ...

Anonymous’s picture

This bug hasn't been fixed yet and is present in both php 4.3.2 and 4.3.3rc2 (latest at the time of this writing).
To fix it, open pgsql.php, change first line in function modifyLimitQuery(..)

$query = $query . " LIMIT $count, $from";


$query = $query . " LIMIT $count OFFSET $from";