Create Table Problem

From: "Shavonne Marietta Wijesinghe" <shavonne(dot)marietta(at)studioform(dot)it>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Create Table Problem
Date: 2008-06-13 12:05:05
Message-ID: 00a601c8cd4d$b7fe2080$0602a8c0@DREAM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello

I'm having some trouble checking if a table exist before i create it.

Example:

SELECT * FROM distributors

IF (table not found) THEN
CREATE TABLE distributors (
did integer,
name varchar(40),
UNIQUE(name)
);
END IF

If i have a table like the above how can i identify if the table exists or not?

Thank You.

Shavonne Wijesinghe

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Volkan YAZICI 2008-06-13 12:31:15 Re: Create Table Problem
Previous Message Steve Midgley 2008-06-12 19:45:11 Re: Tsearch