Re: Test for existence of Table

From: "Anthony E (dot) Greene" <agreene(at)pobox(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Test for existence of Table
Date: 2001-01-05 06:11:51
Message-ID: 20010105011151.U8784@cp5340
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 04 Jan 2001 22:11:31 Gregory Wood wrote:
>> 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

I just tested this with "psql < script.sql" and execution did not stop.
There may be contexts where this error causes execution to stop but it works
at the command line with psql. That implies that it works within psql using
"\i script.sql", which I have also found to be true.

Tony
--
Anthony E. Greene <agreene(at)pobox(dot)com> <http://www.pobox.com/~agreene/>
PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26 C484 A42A 60DD 6C94 239D
Chat: AOL/Yahoo: TonyG05 ICQ: 91183266
Linux. The choice of a GNU Generation. <http://www.linux.org/>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Anand Raman 2001-01-05 06:54:21 pg_dump issues..
Previous Message Justin 2001-01-05 05:37:54 How do I create a check constraint that is based on age difference?