Zend Framework

fix a todo in pgsql.php pdo code public function listTables()

Details

  • Type: Patch Patch
  • Status: Reopened Reopened
  • Priority: Trivial Trivial
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: Next Minor Release
  • Component/s: Zend_Db
  • Labels:
    None

Description

Just a little imrovment as suggested in the code

Issue Links

Activity

Hide
Mickael Perraud added a comment -

Patch applied and tested with r19051

Show
Mickael Perraud added a comment - Patch applied and tested with r19051
Hide
Abdala Cerqueira added a comment -

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' ";
Show
Abdala Cerqueira added a comment - 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' ";
Hide
Ramon Henrique Ornelas added a comment -

Problem in pg_catalog.pg_table_is_visible(c.oid)

resolved through of the

SET search_path TO <my_schemas>

Show
Ramon Henrique Ornelas added a comment - Problem in pg_catalog.pg_table_is_visible(c.oid) resolved through of the SET search_path TO <my_schemas>
Hide
Mickael Perraud added a comment -

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.

Show
Mickael Perraud added a comment - 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.
Hide
Cedric added a comment -

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 Unable to render embedded object: File ((pg_) not found. do you really suggest I can not have a table name "sql_zend" or "pg_rox" ?!)

Show
Cedric added a comment - 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 Unable to render embedded object: File ((pg_) not found. do you really suggest I can not have a table name "sql_zend" or "pg_rox" ?!)

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated: