some fixes to try to get last commit to work with 7.0
authorchriskl <chriskl>
Wed, 5 Nov 2003 15:06:23 +0000 (15:06 +0000)
committerchriskl <chriskl>
Wed, 5 Nov 2003 15:06:23 +0000 (15:06 +0000)
BUGS
classes/database/BaseDB.php
classes/database/Postgres.php
classes/database/Postgres71.php
display.php

diff --git a/BUGS b/BUGS
index de4cca5cf0e5f257ae2a5d51a0a28400aa65ccea..421816a24ba55924548d102ba74c2d0c475cb10e 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -5,5 +5,5 @@ re-enable help system
 all DROP and ALTER commands MUST be fully schema-qualified otherwise you can accidentally drop stuff in pg_catalog :(
 need icons for Casts and Conversions and Languages
 submit changes to HTML_TreeMenu maintainer
-fix up view select feature (select all)  maybe combine this with the table select stuff?
+update Find feature for all new objects
 
index 23b47eff967cfcf4259c6751f16a6a5624b6b9d8..86b73a7f63dd1e6f20887e65ef89d78ca976e772 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: BaseDB.php,v 1.33 2003/11/05 08:32:03 chriskl Exp $
+ * $Id: BaseDB.php,v 1.34 2003/11/05 15:06:23 chriskl Exp $
  */
 
 include_once('classes/database/ADODB_base.php');
@@ -257,6 +257,7 @@ class BaseDB extends ADODB_base {
        function hasAlterTableOwner() { return false; }
        function hasPartialIndexes() { return false; }
        function hasCasts() { return false; }
+       function hasFullSubqueries() { return false; }
 
 }
 
index fdd98df4f6787bab4b71de6314b356c9ebf217c9..cb453ea741be5bee1139d4de39ac73a5a42509e9 100755 (executable)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres.php,v 1.161 2003/11/05 08:32:03 chriskl Exp $
+ * $Id: Postgres.php,v 1.162 2003/11/05 15:06:23 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -1397,7 +1397,10 @@ class Postgres extends BaseDB {
                else $orderby = '';
 
                // Actually retrieve the rows, with offset and limit
-               $rs = $this->selectSet("SELECT * FROM ({$query}) AS sub {$orderby} LIMIT {$page_size} OFFSET " . ($page - 1) * $page_size);
+               if ($this->hasFullSubqueries())
+                       $rs = $this->selectSet("SELECT * FROM ({$query}) AS sub {$orderby} LIMIT {$page_size} OFFSET " . ($page - 1) * $page_size);
+               else
+                       $rs = $this->selectSet("{$query} LIMIT {$page_size} OFFSET " . ($page - 1) * $page_size);
                $status = $this->endTransaction();
                if ($status != 0) {
                        $this->rollbackTransaction();
index 58c98eac5db8fd9ea3d508ab2a20f1f692079611..f61ec5414a415a366d61f91180a626244a714f06 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres71.php,v 1.45 2003/11/05 08:32:03 chriskl Exp $
+ * $Id: Postgres71.php,v 1.46 2003/11/05 15:06:24 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -342,6 +342,7 @@ class Postgres71 extends Postgres {
        function hasRules() { return true; }
        function hasSchemas() { return false; }
        function hasAlterTableOwner() { return true; }
+       function hasFullSubqueries() { return true; }
 
 }
 
index ad1401d3b9544fdbd26da42796b08753d19a76dc..e9fcf6359cab495417f2f25bf7e35ada963f7318 100644 (file)
@@ -9,7 +9,7 @@
         * @param $return_desc The return link name
         * @param $page The current page
         *
-        * $Id: display.php,v 1.29 2003/11/05 08:32:03 chriskl Exp $
+        * $Id: display.php,v 1.30 2003/11/05 15:06:23 chriskl Exp $
         */
 
        // Include application functions
                                        continue;
                                }
                                $finfo = $rs->fetchField($j);
-                               // Display column headers with sorting options
-                               echo "<th class=\"data\"><a href=\"display.php?{$str}&amp;sortkey=", ($j + 1), "&amp;sortdir=";
-                               // Sort direction opposite to current direction, unless it's currently ''
-                               echo ($_REQUEST['sortdir'] == 'asc' && $_REQUEST['sortkey'] == ($j + 1)) ? 'desc' : 'asc';
-                               echo "&amp;strings=", urlencode($_REQUEST['strings']), "\">", 
-                                       $misc->printVal($finfo->name), "</a></th>\n";
+                               // Display column headers with sorting options, unless we're PostgreSQL
+                               // 7.0 and it's a non-TABLE mode
+                               if (!$localData->hasFullSubqueries() && $type != 'TABLE') {
+                                       echo "<th class=\"data\">", $misc->printVal($finfo->name), "</th>\n";
+                               }
+                               else {
+                                       echo "<th class=\"data\"><a href=\"display.php?{$str}&amp;sortkey=", ($j + 1), "&amp;sortdir=";
+                                       // Sort direction opposite to current direction, unless it's currently ''
+                                       echo ($_REQUEST['sortdir'] == 'asc' && $_REQUEST['sortkey'] == ($j + 1)) ? 'desc' : 'asc';
+                                       echo "&amp;strings=", urlencode($_REQUEST['strings']), "\">", 
+                                               $misc->printVal($finfo->name), "</a></th>\n";
+                               }
                                $j++;
                        }