On Tue, 10 May 2005 palanivel.kumaran@scandent.com 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