You want to check if a table already exists.
There is a view called pg_tables or the system table pg_class - you can query either. There is less information in pg_tables but it is easier to understand.
SELECT * FROM pg_tables WHERE tablename LIKE 'foo%'; SELECT * FROM pg_class WHERE relname LIKE 'foo%'; |