"Shavonne Marietta Wijesinghe" <[EMAIL PROTECTED]> writes: > IF (table not found) THEN > CREATE TABLE distributors ( > did integer, > name varchar(40), > UNIQUE(name) > ); > END IF
Assuming you're in a procedure (above code snippet looks to be executed within a PL/pgsql procedure): IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = 'public' AND table_name = 'distributors) THEN ... END IF; Regards. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql