Re: Error dropping non-existent tables

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Baldeep Hira <baldeephira(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Error dropping non-existent tables
Date: 2004-11-20 16:51:13
Message-ID: 20041120165113.GA23127@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Nov 19, 2004 at 21:38:33 -0800,
Baldeep Hira <baldeephira(at)gmail(dot)com> wrote:
>
> I am able to drop tables in PostgreSQL, but the problem arises when
> the table does not exist and I try to execute a "drop table" command.

The simplest fix is to do the drop table outside of a transaction (so
that the error in the drop doesn't break the rest of your script).
If that won't work for you then you can write a custom function that
looks in the system catalog to see if the table exists before trying
the drop.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Green 2004-11-20 16:57:11 Re: phpPgAdmin problem - this list?
Previous Message Tom Lane 2004-11-20 16:44:56 Re: infinite recursion detected in rules for relation "..."