diff --git a/drivers/adodb-postgres64.inc.php b/drivers/adodb-postgres64.inc.php index fa8e5fba7..23a219589 100644 --- a/drivers/adodb-postgres64.inc.php +++ b/drivers/adodb-postgres64.inc.php @@ -258,7 +258,9 @@ function qStr($s, $magic_quotes=false) if ($this->_connectionID) { return "'" . pg_escape_string($this->_connectionID, $s) . "'"; } else { - return "'" . pg_escape_string($s) . "'"; + // Fall back to emulated escaping when there is no database connection. + // Avoids errors when using setSessionVariables() in the load balancer. + return parent::qStr( $s ); } }