In article <BAY133-DAV980F324FFC1159F12BBF7AE680@xxxxxxx>, Martin Gainty <mgainty@xxxxxxxxxxx> wrote: % Assuming your schema will be pg_temp_1 Not a particularly reasonable assumption... % vi InitialTableDisplayStatements.sql % select * from pg_tables where pg_namespace = 'pg_temp1'; pmcphee=# select * from pg_tables where schemaname like 'pg_temp%'; schemaname | tablename | tableowner | tablespace | hasindexes | hasrules | hastriggers ------------+-----------+------------+------------+------------+----------+------------- pg_temp_2 | x | pmcphee | x | f | f | f (1 row) pmcphee=# select * from x; ERROR: relation "x" does not exist But the test itself is problematic. I think this query is better. select pg_table_is_visible(pg_class.oid) from pg_class, pg_namespace where relname = 'x' and relnamespace = pg_namespace.oid and nspname like 'pg_temp%';