Re: Create Table Problem - Mailing list pgsql-sql

From Volkan YAZICI
Subject Re: Create Table Problem
Date
Msg-id 87y759wm7g.fsf@alamut.mobiliz.com.tr
Whole thread Raw
In response to Create Table Problem  ("Shavonne Marietta Wijesinghe" <shavonne.marietta@studioform.it>)
List pgsql-sql
"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.


pgsql-sql by date:

Previous
From: "Shavonne Marietta Wijesinghe"
Date:
Subject: Create Table Problem
Next
From: Andreas
Date:
Subject: How to manage category-ids as array-fields ?