allow editing select results by oid. that will make some people happy.
authorchriskl <chriskl>
Tue, 10 Feb 2004 06:55:08 +0000 (06:55 +0000)
committerchriskl <chriskl>
Tue, 10 Feb 2004 06:55:08 +0000 (06:55 +0000)
BUGS
HISTORY
classes/database/BaseDB.php

diff --git a/BUGS b/BUGS
index beb3646071898b56cc8092892962ed8f6f476d8a..f71b2f45089de0b89965c4d462c0a68baf4a1dc1 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -13,7 +13,6 @@ test < 7.3 Find feature for all new objects
 fix constraint search to get domain and table constraints?
 dump sequences when dumping tables
 fix dumping clustering info
-can't edit SELECT results by oid
 
 Need to fix:
 * The getType function needs to be ported to 7.2 and 7.3 classes to add
@@ -21,5 +20,5 @@ Need to fix:
 * Report login errors
 * Edit Query
 * Don't offer owner change feature if user is not superuser
-
+* fix encoding in popup window
 
diff --git a/HISTORY b/HISTORY
index 7943b9d7ed28119f11f359466029da0285b62983..a2a0948d5a43cc0e54255512457b594cdac118fa 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -15,6 +15,7 @@ Features
 * Display user session defaults for PostgreSQL >= 7.3
 * Rename user feature for PostgreSQL >= 7.4
 * Create functions returning arrays and table types
+* Allow editing Select results by oid
 
 Bugs
 * Object browser fixed for databases with no schemas
index 610a5effabb0f9f196d9ac1fe48f62079f9c6392..a2a36006058ee4cc9a4636cbcc4d88534180082a 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.38 2004/02/02 12:15:58 chriskl Exp $
+ * $Id: BaseDB.php,v 1.39 2004/02/10 06:55:09 chriskl Exp $
  */
 
 include_once('./classes/database/ADODB_base.php');
@@ -161,12 +161,20 @@ class BaseDB extends ADODB_base {
                // If an empty array is passed in, then show all columns
                if (sizeof($show) == 0) {
                        if ($this->hasObjectID($table))
-                               $sql = "SELECT oid, * FROM ";
+                               $sql = "SELECT \"{$this->id}\", * FROM ";
                        else
                                $sql = "SELECT * FROM ";
                }
-               else
-                       $sql = "SELECT \"" . join('","', $show) . "\" FROM ";
+               else {
+                       // Add oid column automatically to results for editing purposes
+                       if (!in_array($this->id, $show) && $this->hasObjectID($table))
+                               $sql = "SELECT \"{$this->id}\", \"";
+                       else
+                               $sql = "SELECT \"";
+                       
+                       $sql .= join('","', $show) . "\" FROM ";
+               }
+                       
                if ($this->hasSchemas() && isset($_REQUEST['schema'])) {
                        $this->fieldClean($_REQUEST['schema']);
                        $sql .= "\"{$_REQUEST['schema']}\".";