Postgres::getTables PHP Method

getTables() public method

Return all tables in current database (and schema)
public getTables ( $all = false ) : All
$all True to fetch all tables, false for just in current schema
return All tables, sorted alphabetically
    function getTables($all = false)
    {
        $c_schema = $this->_schema;
        $this->clean($c_schema);
        if ($all) {
            // Exclude pg_catalog and information_schema tables
            $sql = "SELECT schemaname AS nspname, tablename AS relname, tableowner AS relowner\n\t\t\t\t\tFROM pg_catalog.pg_tables\n\t\t\t\t\tWHERE schemaname NOT IN ('pg_catalog', 'information_schema', 'pg_toast')\n\t\t\t\t\tORDER BY schemaname, tablename";
        } else {
            $sql = "SELECT c.relname, pg_catalog.pg_get_userbyid(c.relowner) AS relowner,\n\t\t\t\t\t\tpg_catalog.obj_description(c.oid, 'pg_class') AS relcomment,\n\t\t\t\t\t\treltuples::bigint,\n\t\t\t\t\t\t(SELECT spcname FROM pg_catalog.pg_tablespace pt WHERE pt.oid=c.reltablespace) AS tablespace\n\t\t\t\t\tFROM pg_catalog.pg_class c\n\t\t\t\t\tLEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n\t\t\t\t\tWHERE c.relkind = 'r'\n\t\t\t\t\tAND nspname='{$c_schema}'\n\t\t\t\t\tORDER BY c.relname";
        }
        return $this->selectSet($sql);
    }
Postgres