Re: Test for existence of Table - Mailing list pgsql-general

From Gregory Wood
Subject Re: Test for existence of Table
Date
Msg-id 002501c076c5$35194fa0$7889ffcc@comstock.com
Whole thread Raw
In response to RE: Test for existence of Table  ("Craig L. Ching" <cching@mqsoftware.com>)
Responses Re: Test for existence of Table  ("Anthony E . Greene" <agreene@pobox.com>)
List pgsql-general
> DROP TABLE employees
Error: ERROR:  Relation 'employees' does not exist

And execution halts.... which is I believe why he wanted to check for the
existence before trying to DROP. I'd love to know if this exists as well...
would come in very handy during development time.

Greg

> Yeah,
>
> DROP TABLE employees
> CREATE TABLE employees
>
> ;-)
>
> Craig
>
> -----Original Message-----
> From: Soma Interesting [mailto:dfunct@telus.net]
> Sent: Thursday, January 04, 2001 1:40 PM
> To: pgsql-general@postgresql.org
> Subject: [GENERAL] Test for existence of Table
>
>
> Can I test for an existing table before issuing the "CREATE TABLE"
command?
>
> IF EXISTS employees{
>          DROP TABLE employees
> }
> CREATE TABLE employees
>
> Can you provide an example of this. I couldn't find this in the manual or
> Bruce's book - did I not look hard enough ? :)
>
>
> -          -          -          -          -          -          -
>   -          -          -          -
> WARNING: Some experts believe that use of any keyboard may cause
> serious injury. Consult Users Guide.
>
> dfunct@telus.net
>


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump return status..
Next
From: Blake Crosby
Date:
Subject: Re: Time Zone Query