Re: dropping non-existent tables - Mailing list pgsql-general

From mark reid
Subject Re: dropping non-existent tables
Date
Msg-id 42E6716A.7020902@markreid.org
Whole thread Raw
In response to dropping non-existent tables  ("Walsh, Richard (Richard)" <richardwalsh@avaya.com>)
List pgsql-general
Hello,

You can use the information_schema.* tables, which are part of the SQL
standard (and thus not proprietary).

-Mark.

Walsh, Richard (Richard) wrote:

> Hi,
> I have a problem in that I need to drop non-existent tables in a DDL
> script. This is in order that the script can re-build a database
> schema if the tables already exist. However, in Postgres this is
> proving to be a problem because if the table does not exist then the
> DDL execution will stop once it gets an error. I know that I can
> create a custom function that will check the relevant postGres table
> to see if the table already exists, but I don't want to do this as I
> would like to keep the DDL as non-proprietary as possible. Anyone any
> ideas on a work-around for this problem that does not involve creating
> a custom function.
> thanks,
> Richie.


pgsql-general by date:

Previous
From: Edwin Hernán Barrios Núñez
Date:
Subject: Re: GUID for postgreSQL
Next
From: Andrew Stewart
Date:
Subject: Re: Daily digest?