Changeset 719


Ignore:
Timestamp:
Jan 12, 2016, 7:27:13 AM (4 years ago)
Author:
cito
Message:

Better checks for system catalogs

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.x/pg.py

    r718 r719  
    591591                " JOIN pg_namespace"
    592592                    " ON pg_namespace.oid = pg_class.relnamespace"
    593                     " AND pg_namespace.nspname NOT LIKE 'pg_%'"
     593                    " AND pg_namespace.nspname"
     594                    " NOT SIMILAR TO 'pg/_%|information/_schema' ESCAPE '/'"
    594595                " JOIN pg_attribute ON pg_attribute.attrelid = pg_class.oid"
    595596                    " AND pg_attribute.attisdropped = 'f'"
     
    626627            " FROM pg_class "
    627628            " JOIN pg_namespace ON pg_namespace.oid = pg_class.relnamespace "
    628             " WHERE %s pg_namespace.nspname != 'information_schema'"
    629                 " AND pg_namespace.nspname !~ '^pg_' "
     629            " WHERE %s pg_namespace.nspname"
     630            " NOT SIMILAR TO 'pg/_%%|information/_schema' ESCAPE '/'"
    630631            " ORDER BY 1, 2" % where).getresult()]
    631632
  • trunk/pg.py

    r718 r719  
    592592                " JOIN pg_namespace"
    593593                    " ON pg_namespace.oid = pg_class.relnamespace"
    594                     " AND pg_namespace.nspname NOT LIKE 'pg_%'"
     594                    " AND pg_namespace.nspname"
     595                    " NOT SIMILAR TO 'pg/_%|information/_schema' ESCAPE '/'"
    595596                " JOIN pg_attribute ON pg_attribute.attrelid = pg_class.oid"
    596597                    " AND NOT pg_attribute.attisdropped"
     
    628629            " FROM pg_class "
    629630            " JOIN pg_namespace ON pg_namespace.oid = pg_class.relnamespace "
    630             " WHERE %s pg_namespace.nspname != 'information_schema'"
    631                 " AND pg_namespace.nspname !~ '^pg_' "
     631            " WHERE %s pg_namespace.nspname"
     632            " NOT SIMILAR TO 'pg/_%%|information/_schema' ESCAPE '/'"
    632633            " ORDER BY 1, 2" % where).getresult()]
    633634
Note: See TracChangeset for help on using the changeset viewer.