exclude system columns, sequence columns and dropped columns from search results...
authorchriskl <chriskl>
Wed, 3 Sep 2003 05:46:20 +0000 (05:46 +0000)
committerchriskl <chriskl>
Wed, 3 Sep 2003 05:46:20 +0000 (05:46 +0000)
classes/database/Postgres.php
classes/database/Postgres73.php

index bc31daeb02f6eefdd478c5e2513c9aaaf3e26cfa..baf00ed567d5434bc76de18c49f7a10d8f0a83b9 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.142 2003/09/03 05:32:13 chriskl Exp $
+ * $Id: Postgres.php,v 1.143 2003/09/03 05:46:20 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -1606,7 +1606,7 @@ class Postgres extends BaseDB {
                        UNION ALL
                        SELECT 'COLUMN', NULL, NULL, pc.relname, pa.attname FROM pg_class pc,
                                pg_attribute pa WHERE pc.oid=pa.attrelid 
-                               AND pa.attname ~* '.*{$term}.*'";
+                               AND pa.attname ~* '.*{$term}.*' AND pa.attnum > 0 AND pc.relkind IN ('r', 'v')";
                if (!$conf['show_system']) $sql .= " AND pc.relname NOT LIKE 'pg_%'";                           
 
                $sql .= "
@@ -1625,7 +1625,7 @@ class Postgres extends BaseDB {
                        UNION ALL
                        SELECT 'OPERATOR', po.oid, NULL, NULL, po.oprname FROM pg_operator po
                                WHERE oprname ~* '.*{$term}.*'";
-               if (!$conf['show_system']) $sql .= " AND po.oid > '{$this->_lastSystemOID}'::oid";
+               if (!$conf['show_system']) $sql .= " AND po.oid > '{$this->_lastSystemOID}'::oid\n";
                                
                $sql .= "ORDER BY type, schemaname, relname, name";
                        
index 52be45ebb6119c21ec58e36c08ae304edf30a243..2c885e042ad9496ace87c4e38e698472e6fff485 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.61 2003/08/27 08:09:26 chriskl Exp $
+ * $Id: Postgres73.php,v 1.62 2003/09/03 05:46:20 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -1025,7 +1025,7 @@ class Postgres73 extends Postgres72 {
                        UNION ALL
                        SELECT 'COLUMN', NULL, pn.nspname, pc.relname, pa.attname FROM pg_catalog.pg_class pc, pg_catalog.pg_namespace pn,
                                pg_catalog.pg_attribute pa WHERE pc.relnamespace=pn.oid AND pc.oid=pa.attrelid 
-                               AND pa.attname ILIKE '%{$term}%' {$where}
+                               AND pa.attname ILIKE '%{$term}%' AND pa.attnum > 0 AND NOT pa.attisdropped AND pc.relkind IN ('r', 'v') {$where}
                        UNION ALL
                        SELECT 'FUNCTION', pp.oid, pn.nspname, NULL, pp.proname FROM pg_catalog.pg_proc pp, pg_catalog.pg_namespace pn 
                                WHERE pp.pronamespace=pn.oid AND proname ILIKE '%{$term}%' {$where}