On Tue, 10 May 2005 [EMAIL PROTECTED] wrote:

I need to check for the existence of a user defined view named 'audit_vw'
and if exists, then i need to delete the same. Please help me to solve the
issue.

If you don't need to do anything else in the transaction, you could just issue "DROP VIEW audit_vw" and see if it succeeds or fails.


If you do need to do something else in the same transaction, you can use savepoints:

BEGIN;
SAVEPOINT sp;
DROP VIEW audit_vw;
if it fails: ROLLBACK TO sp;
...
COMMIT;

Ps. This kind of questions are usually discussed on the pgsql-general mailing list.

- Heikki

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
     joining column's datatypes do not match

Reply via email to