"Shavonne Marietta Wijesinghe" <shavonne.marietta@studioform.it> 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.