ZF-8046: fix a todo in pgsql.php pdo code public function listTables()

Description

Just a little imrovment as suggested in the code

Comments

Patch applied and tested with r19051

It did not work. I use PostgreSql version 1.8.4

My sugestion:


$sql = "SELECT c.relname  AS table_name "
              . "FROM pg_catalog.pg_class c "
              . "JOIN pg_catalog.pg_roles r ON r.oid = c.relowner "
              . "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace "
              . "WHERE n.nspname <> 'pg_catalog' "
              . "AND n.nspname !~ '^pg_toast' "
              . "AND c.relname !~ '^(pg_|sql_)' "
              . "AND c.relkind = 'r' ";

Problem in pg_catalog.pg_table_is_visible(c.oid)

resolved through of the

SET search_path TO

My fault, this commit wasn't suppose to be in branch but only in trunk that's why the "Fix Versions" field was "Next minor release" I will revert it in branch ASAP.

I failed to answer and have to re-edit the ticket..

All is to know what do you realy expect when using show tables. Query provided is fine.

Perhaps you just want to select like that :

select table_schema, table_name from information_schema.tables where table_schema <> 'pg_catalog' and table_schema !~ '^pg_toast' and table_schema <> 'information_schema';

or just ommit the is_visible from the First query, but please keep clear of that : "AND c.relname !~ '^(pg_|sql_)' " which is useless and can just lead to errors. (damn! do you really suggest I can not have a table name "sql_zend" or "pg_rox" ?!)