From 153a2e9450d68a017645bdd890edcddcb8bbff77 Mon Sep 17 00:00:00 2001 From: chriskl Date: Sat, 3 Sep 2005 05:01:37 +0000 Subject: [PATCH] Eliminate empty schemas from set search_path command. Still don't know how they get in there exactly - it's a bug in the multiserver code. --- classes/database/Postgres73.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/classes/database/Postgres73.php b/classes/database/Postgres73.php index 3dcdada8..ae328026 100644 --- a/classes/database/Postgres73.php +++ b/classes/database/Postgres73.php @@ -4,7 +4,7 @@ * A class that implements the DB interface for Postgres * Note: This class uses ADODB and returns RecordSets. * - * $Id: Postgres73.php,v 1.151 2005/08/31 20:49:10 xzilla Exp $ + * $Id: Postgres73.php,v 1.152 2005/09/03 05:01:37 chriskl Exp $ */ // @@@ THOUGHT: What about inherits? ie. use of ONLY??? @@ -94,9 +94,15 @@ class Postgres73 extends Postgres72 { // Need to handle empty paths in some cases $paths[0] = 'pg_catalog'; } - $this->fieldArrayClean($paths); + + // Loop over all the paths to check that none are empty + $temp = array(); + foreach ($paths as $schema) { + if ($schema != '') $temp[] = $schema; + } + $this->fieldArrayClean($temp); - $sql = 'SET SEARCH_PATH TO "' . implode('","', $paths) . '"'; + $sql = 'SET SEARCH_PATH TO "' . implode('","', $temp) . '"'; return $this->execute($sql); } -- 2.39.5