Browse files

Additional fix of queries to correctly exclude internal schemas.

 * pyrseas/testutils.py (PostgresDb.clear): Exclude pg_catalog and
   information_schema instead of joining to pg_roles.

See commits 5a6e4bc and 8d92dd8 10 Oct 2011 for original changes.
  • Loading branch information...
1 parent c116b3b commit d361b6759d2a36159024b803d113410526154c4f @jmafc jmafc committed Mar 12, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 pyrseas/testutils.py
View
4 pyrseas/testutils.py
@@ -123,9 +123,9 @@ def clear(self):
self.conn,
"""SELECT nspname, relname, relkind FROM pg_class
JOIN pg_namespace ON (relnamespace = pg_namespace.oid)
- JOIN pg_roles ON (nspowner = pg_roles.oid)
WHERE relkind in ('r', 'S', 'v', 'f')
- AND (nspname = 'public' OR rolname <> 'postgres')
+ AND (nspname != 'pg_catalog'
+ AND nspname != 'information_schema')
ORDER BY relkind DESC""")
objs = curs.fetchall()
curs.close()

0 comments on commit d361b67

Please sign in to comment.