How to check whether a table already exists or not before executing a creation script?
for example in MySQL database, we can do
IF NOT EXISTS tableName ..then create table sql script to follow
how about in PostgreSQL? Is there a way to check first if the table exists before creating it? How do we do it?
PostgreSQL uses the following syntax:
CREATE TABLE IF NOT EXISTS mytable (
-- Column definitions...
)