Re: Please clarify

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Please clarify
Дата
Msg-id Pine.OSF.4.61.0505102119450.368341@kosh.hut.fi
обсуждение исходный текст
Ответ на Please clarify  (palanivel.kumaran@scandent.com)
Список pgsql-hackers
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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Oracle Style packages on postgres
Следующее
От: "Merlin Moncure"
Дата:
Сообщение: FW: Views, views, views! (long)