Re: before insert for each row trigger on upsert

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: before insert for each row trigger on upsert
Дата
Msg-id 27384.1582236718@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: before insert for each row trigger on upsert  (Ted Toth <txtoth@gmail.com>)
Список pgsql-general
Ted Toth <txtoth@gmail.com> writes:
> I think you are right in that the trigger doesn't change the row being
> updated (which is good) but it also updates another table and that's what
> I'd actually like to avoid on update.

Probably need to put that in an AFTER trigger, then.  By definition,
BEFORE triggers don't really know whether the insert is going to
happen.  This doesn't even require use of upsert to cause a problem:
a later BEFORE trigger could prevent the insertion, or change what
gets inserted.

            regards, tom lane



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

Предыдущее
От: Roberto Della Pasqua
Дата:
Сообщение: spectrogram index?
Следующее
От: "Andrus"
Дата:
Сообщение: Re: How to fix 0xC0000005 exception in Postgres 9.0