Checking for table existence

From: "Julester" <cubalibr(at)optonline(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Checking for table existence
Date: 2001-09-14 18:58:29
Message-ID: prso7.50245$f7.6232115@news02.optonline.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi everyone. In my old SQL Server days, I used a command such as "IF
exists(select name from sys_objects where name = 'xyztable')" to check if a
table existed before creating it with a standard CREATE command. I looked
in the PostgreSQL documentation, but for the life of me, I can't find an
equivalent. I can view if the table exists by doing a select against the
meta-data tables, but what about the IF statement ? Any help would be
greatly appreciated. Thanks.

Julester

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2001-09-14 19:19:58 Re: SQL request change when upgrade from 7.0.2 to 7.1.3
Previous Message Jeff Eckermann 2001-09-14 18:50:15 Re: Number the lines