Re: [GENERAL] Trigger or Rule?

Поиск
Список
Период
Сортировка
Искать
От
Adriaan Joubert
Тема
Re: [GENERAL] Trigger or Rule?
Дата
Msg-id
37246B24.6C4BC4C3@albourne.com
Список
Дерево обсуждения
re: left join Silvio Macedo <smacedo@inescn.pt>
Trigger or Rule? Andy Lewis <alewis@themecca.net>
> 
> select count(*) into cnt from  where new. = key;
> if (cnt>0) then
>         delete from  where key = new.
> end if
> 

Just looked at this, and this is not actually what you wanted. If you do
not want to replace the old row, do something along the lines

RAISE EXCEPTION ''Duplicate entry''

which will abort the insert. It's all in the manual.

Adriaan
В списке pgsql-general по дате отправления
От: Adriaan Joubert
Дата:
Сообщение: Re: [GENERAL] Trigger or Rule?
От: Statistical Solutions
Дата:
FAQ