Commit 65901e63 authored by x42p's avatar x42p Committed by Steve Müller

Update PostgreSqlPlatform.php

I take the guess an use the information_schema. It makes it more clear and simple
parent 18b3026f
...@@ -243,14 +243,11 @@ class PostgreSqlPlatform extends AbstractPlatform ...@@ -243,14 +243,11 @@ class PostgreSqlPlatform extends AbstractPlatform
*/ */
public function getListSequencesSQL($database) public function getListSequencesSQL($database)
{ {
return "SELECT return "SELECT sequence_name AS relname,
c.relname, n.nspname AS schemaname sequence_schema AS schemaname
FROM FROM information_schema.sequences
pg_class c, pg_namespace n WHERE sequence_schema NOT LIKE 'pg_%'
WHERE relkind = 'S' AND sequence_schema != 'information_schema'";
AND n.oid = c.relnamespace
AND (n.nspname NOT LIKE 'pg_%' AND n.nspname != 'information_schema')
AND pg_table_is_visible(c.oid) is true";
} }
/** /**
...@@ -258,17 +255,13 @@ class PostgreSqlPlatform extends AbstractPlatform ...@@ -258,17 +255,13 @@ class PostgreSqlPlatform extends AbstractPlatform
*/ */
public function getListTablesSQL() public function getListTablesSQL()
{ {
return "SELECT quote_ident(t.tablename) AS table_name, return "SELECT quote_ident(table_name) AS table_name,
t.schemaname AS schema_name table_schema AS schema_name
FROM pg_tables t, FROM information_schema.tables
pg_class c WHERE table_schema NOT LIKE 'pg_%'
WHERE t.tablename = c.relname AND table_schema != 'information_schema'
AND c.relkind = 'r' AND table_name != 'geometry_columns'
AND pg_table_is_visible(c.oid) is true AND table_name != 'spatial_ref_sys'";
AND t.schemaname NOT LIKE 'pg_%'
AND schemaname != 'information_schema'
AND tablename != 'geometry_columns'
AND tablename != 'spatial_ref_sys'";
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment