Retreive default 'search_path' from the database.
authorjollytoad <jollytoad>
Wed, 14 Jul 2004 10:24:26 +0000 (10:24 +0000)
committerjollytoad <jollytoad>
Wed, 14 Jul 2004 10:24:26 +0000 (10:24 +0000)
Removed implicit inclusion of 'pg_catalog' to end of search_path.

classes/database/Postgres73.php
sqledit.php

index 60274f21332f4d6a934ba6ca8365474ddbd5a93e..b445458093699ae436d8f7326787e8e788ee3c93 100644 (file)
@@ -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
index e42088086020b7d33796202bdeb5e80e525dc0b5..90190faa6c693ef3c24affea2cd7013fe5b053b9 100644 (file)
@@ -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
 
                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<label>{$lang['strsearchpath']}:&nbsp;<input type=\"text\" name=\"search_path\" size=\"30\" value=\"",
                                htmlspecialchars($_REQUEST['search_path']), "\" /></label>";