Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Anonymous (not verified) on
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?
Comments
PEAR problem
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 ...PEAR Problem
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(..)
from:
$query = $query . " LIMIT $count, $from";
to:
$query = $query . " LIMIT $count OFFSET $from";