From b2f6f47f221fbf003556f8884beca68757fea27d Mon Sep 17 00:00:00 2001 From: jollytoad Date: Wed, 14 Jul 2004 10:24:26 +0000 Subject: [PATCH] Retreive default 'search_path' from the database. Removed implicit inclusion of 'pg_catalog' to end of search_path. --- classes/database/Postgres73.php | 12 ++++++++++-- sqledit.php | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/classes/database/Postgres73.php b/classes/database/Postgres73.php index 60274f21..b4454580 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.127 2004/07/13 16:33:36 jollytoad Exp $ + * $Id: Postgres73.php,v 1.128 2004/07/14 10:24:26 jollytoad Exp $ */ // @@@ THOUGHT: What about inherits? ie. use of ONLY??? @@ -84,10 +84,18 @@ class Postgres73 extends Postgres72 { elseif (sizeof($paths) == 0) return -2; $this->fieldArrayClean($paths); - $sql = 'SET SEARCH_PATH TO "' . implode('","', $paths) . '", pg_catalog'; + $sql = 'SET SEARCH_PATH TO "' . implode('","', $paths) . '"'; return $this->execute($sql); } + + /** + * Return the default schema search path + */ + function getSearchPath() { + $sql = 'SHOW search_path'; + return $this->selectField($sql, 'search_path'); + } /** * Return all schemas in the current database diff --git a/sqledit.php b/sqledit.php index e4208808..90190faa 100644 --- a/sqledit.php +++ b/sqledit.php @@ -3,7 +3,7 @@ /** * Alternative SQL editing window * - * $Id: sqledit.php,v 1.18 2004/07/13 15:24:41 jollytoad Exp $ + * $Id: sqledit.php,v 1.19 2004/07/14 10:24:26 jollytoad Exp $ */ // Include application functions @@ -135,7 +135,7 @@ if ($data->hasSchemas()) { if (!isset($_REQUEST['search_path'])) - $_REQUEST['search_path'] = '$user, public'; // Should this be retrieved from a $data function? + $_REQUEST['search_path'] = $data->getSearchPath(); echo "\n"; -- 2.39.5