Commit e3bf698e authored by Steve Müller's avatar Steve Müller

only introspect namespaces and views accessible

parent 3ffc2e45
...@@ -235,7 +235,10 @@ class PostgreSqlPlatform extends AbstractPlatform ...@@ -235,7 +235,10 @@ class PostgreSqlPlatform extends AbstractPlatform
*/ */
public function getListNamespacesSQL() public function getListNamespacesSQL()
{ {
return "SELECT nspname FROM pg_namespace WHERE nspname NOT LIKE 'pg_%' AND nspname != 'information_schema'"; return "SELECT schema_name AS nspname
FROM information_schema.schemata
WHERE schema_name NOT LIKE 'pg_%'
AND schema_name != 'information_schema'";
} }
/** /**
...@@ -243,10 +246,10 @@ class PostgreSqlPlatform extends AbstractPlatform ...@@ -243,10 +246,10 @@ class PostgreSqlPlatform extends AbstractPlatform
*/ */
public function getListSequencesSQL($database) public function getListSequencesSQL($database)
{ {
return "SELECT sequence_name AS relname, return "SELECT sequence_name AS relname,
sequence_schema AS schemaname sequence_schema AS schemaname
FROM information_schema.sequences FROM information_schema.sequences
WHERE sequence_schema NOT LIKE 'pg_%' WHERE sequence_schema NOT LIKE 'pg_%'
AND sequence_schema != 'information_schema'"; AND sequence_schema != 'information_schema'";
} }
...@@ -255,12 +258,12 @@ class PostgreSqlPlatform extends AbstractPlatform ...@@ -255,12 +258,12 @@ class PostgreSqlPlatform extends AbstractPlatform
*/ */
public function getListTablesSQL() public function getListTablesSQL()
{ {
return "SELECT quote_ident(table_name) AS table_name, return "SELECT quote_ident(table_name) AS table_name,
table_schema AS schema_name table_schema AS schema_name
FROM information_schema.tables FROM information_schema.tables
WHERE table_schema NOT LIKE 'pg_%' WHERE table_schema NOT LIKE 'pg_%'
AND table_schema != 'information_schema' AND table_schema != 'information_schema'
AND table_name != 'geometry_columns' AND table_name != 'geometry_columns'
AND table_name != 'spatial_ref_sys'"; AND table_name != 'spatial_ref_sys'";
} }
...@@ -269,7 +272,11 @@ class PostgreSqlPlatform extends AbstractPlatform ...@@ -269,7 +272,11 @@ class PostgreSqlPlatform extends AbstractPlatform
*/ */
public function getListViewsSQL($database) public function getListViewsSQL($database)
{ {
return 'SELECT quote_ident(viewname) as viewname, schemaname, definition FROM pg_views'; return 'SELECT quote_ident(table_name) AS viewname,
table_schema AS schemaname,
view_definition AS definition
FROM information_schema.views
WHERE view_definition IS NOT NULL';
} }
/** /**
......
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