More accurate method of listing tables for postgres

This commit is contained in:
Timothy Warren 2012-04-17 10:49:38 -04:00
parent f7d18b19fd
commit 66c21338d0
2 changed files with 6 additions and 5 deletions

View File

@ -173,10 +173,11 @@ SQL;
public function table_list() public function table_list()
{ {
return <<<SQL return <<<SQL
SELECT "tablename" FROM "pg_tables" SELECT "table_name"
WHERE "tablename" NOT LIKE 'pg_%' FROM "information_schema"."tables"
AND "tablename" NOT LIKE 'sql_%' WHERE "table_type" = 'BASE TABLE'
ORDER BY "tablename" ASC AND "table_schema" NOT IN
('pg_catalog', 'information_schema');
SQL; SQL;
} }
@ -191,7 +192,7 @@ SQL;
{ {
return <<<SQL return <<<SQL
SELECT "tablename" FROM "pg_tables" SELECT "tablename" FROM "pg_tables"
WHERE "tablename" LIKE 'pg\_%' WHERE "tablename" ~ '^(pg_|sql_)'
SQL; SQL;
} }

Binary file not shown.