* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.163 2003/11/15 10:40:25 chriskl Exp $
+ * $Id: Postgres.php,v 1.164 2003/11/19 02:12:47 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
*/
function &getTables($all = false) {
global $conf;
- if (!$conf['show_system'] || $all) $where = "WHERE tablename NOT LIKE 'pg_%' ";
+ if (!$conf['show_system'] || $all) $where = "WHERE tablename NOT LIKE 'pg\\\\_%' ";
else $where = '';
$sql = "SELECT NULL AS schemaname, tablename, tableowner FROM pg_tables {$where}ORDER BY tablename";
return $this->selectSet($sql);
function &getViews() {
global $conf;
if (!$conf['show_system'])
- $where = "WHERE viewname NOT LIKE 'pg_%'";
+ $where = "WHERE viewname NOT LIKE 'pg\\\\_%'";
else $where = '';
$sql = "SELECT viewname, viewowner FROM pg_views {$where} ORDER BY viewname";
SELECT CASE WHEN relkind='r' THEN 'TABLE'::VARCHAR WHEN relkind='v' THEN 'VIEW'::VARCHAR WHEN relkind='S' THEN 'SEQUENCE'::VARCHAR END AS type,
pc.oid, NULL::VARCHAR AS schemaname, NULL::VARCHAR AS relname, pc.relname AS name FROM pg_class pc
WHERE relkind IN ('r', 'v', 'S') AND relname ~* '.*{$term}.*'";
- if (!$conf['show_system']) $sql .= " AND pc.relname NOT LIKE 'pg_%'";
+ if (!$conf['show_system']) $sql .= " AND pc.relname NOT LIKE 'pg\\\\_%'";
// Columns
$sql .= "
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.attnum > 0 AND pc.relkind IN ('r', 'v')";
- if (!$conf['show_system']) $sql .= " AND pc.relname NOT LIKE 'pg_%'";
+ if (!$conf['show_system']) $sql .= " AND pc.relname NOT LIKE 'pg\\\\_%'";
// Functions
$sql .= "
pg_index pi, pg_class pc2 WHERE pc.oid=pi.indrelid
AND pi.indexrelid=pc2.oid
AND pc2.relname ~* '.*{$term}.*' AND NOT pi.indisprimary AND NOT pi.indisunique";
- if (!$conf['show_system']) $sql .= " AND pc2.relname NOT LIKE 'pg_%'";
+ if (!$conf['show_system']) $sql .= " AND pc2.relname NOT LIKE 'pg\\\\_%'";
// Check Constraints
$sql .= "
SELECT 'CONSTRAINT', NULL, NULL, pc.relname, pr.rcname FROM pg_class pc,
pg_relcheck pr WHERE pc.oid=pr.rcrelid
AND pr.rcname ~* '.*{$term}.*'";
- if (!$conf['show_system']) $sql .= " AND pc.relname NOT LIKE 'pg_%'";
+ if (!$conf['show_system']) $sql .= " AND pc.relname NOT LIKE 'pg\\\\_%'";
// Unique and Primary Key Constraints
$sql .= "
UNION ALL
pg_index pi, pg_class pc2 WHERE pc.oid=pi.indrelid
AND pi.indexrelid=pc2.oid
AND pc2.relname ~* '.*{$term}.*' AND (pi.indisprimary OR pi.indisunique)";
- if (!$conf['show_system']) $sql .= " AND pc2.relname NOT LIKE 'pg_%'";
+ if (!$conf['show_system']) $sql .= " AND pc2.relname NOT LIKE 'pg\\\\_%'";
// Triggers
$sql .= "
SELECT 'TRIGGER', NULL, NULL, pc.relname, pt.tgname FROM pg_class pc,
pg_trigger pt WHERE pc.oid=pt.tgrelid
AND pt.tgname ~* '.*{$term}.*'";
- if (!$conf['show_system']) $sql .= " AND pc.relname NOT LIKE 'pg_%'";
+ if (!$conf['show_system']) $sql .= " AND pc.relname NOT LIKE 'pg\\\\_%'";
// Rules
$sql .= "
UNION ALL
SELECT 'RULE', NULL, NULL, tablename, rulename FROM pg_rules
WHERE rulename ~* '.*{$term}.*'";
- if (!$conf['show_system']) $sql .= " AND tablename NOT LIKE 'pg_%'";
+ if (!$conf['show_system']) $sql .= " AND tablename NOT LIKE 'pg\\\\_%'";
// Advanced Objects
if ($conf['show_advanced']) {
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres73.php,v 1.78 2003/11/08 10:33:57 chriskl Exp $
+ * $Id: Postgres73.php,v 1.79 2003/11/19 02:12:48 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
*/
function &getSchemas() {
global $conf;
-
- if (!$conf['show_system']) $and = "AND nspname NOT LIKE 'pg_%'";
+
+ if (!$conf['show_system']) $and = "AND nspname NOT LIKE 'pg\\\\_%'";
else $and = '';
$sql = "SELECT pn.nspname, pu.usename AS nspowner FROM pg_catalog.pg_namespace pn, pg_catalog.pg_user pu
WHERE pn.nspowner = pu.usesysid
// Exclude system relations if necessary
if (!$conf['show_system']) {
- $where = " AND pn.nspname NOT LIKE 'pg_%'";
+ $where = " AND pn.nspname NOT LIKE 'pg\\\\_%'";
$lan_where = "AND pl.lanispl";
- $rule_where = " AND schemaname NOT LIKE 'pg_%'";
+ $rule_where = " AND schemaname NOT LIKE 'pg\\\\_%'";
}
else {
$where = '';
$where = '';
else
$where = "
- AND n1.nspname NOT LIKE 'pg_%'
- AND n2.nspname NOT LIKE 'pg_%'
- AND n3.nspname NOT LIKE 'pg_%'
+ AND n1.nspname NOT LIKE 'pg\\\\_%'
+ AND n2.nspname NOT LIKE 'pg\\\\_%'
+ AND n3.nspname NOT LIKE 'pg\\\\_%'
";
$sql = "