Re: Trigger

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Trigger
Дата
Msg-id 20031023064929.I12332@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Re: Trigger  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Список pgsql-general
On Thu, 23 Oct 2003, Alvaro Herrera wrote:

> On Thu, Oct 23, 2003 at 08:16:27AM +0100, Peter Childs wrote:
> >
> >
> > On Wed, 22 Oct 2003, scott.marlowe wrote:
> >
> > > On Wed, 22 Oct 2003, Peter Childs wrote:
> > >
> > > >     Is it possible to deferr a trigger until commit, Or to have the
> > > > trigger not occur if the transaction is rolled back? Like transaction.
> >
> >     Background, we are trying to get the database to tell clients when
> > records get updated, deleted or inserted so that they can update there
> > on-screen displays without having to query the database every couple of
> > seconds which would put an unnessary strain on the database. Hence
> > producing quicker respose times.
>
> You should probably be using an AFTER trigger ... when those get
> executed, the transaction is ready to commit and will not abort (barring
> any major problems, like your server go nuts or something).

This is not true, actually. After triggers generally happen at the end of
statement (with the exception of deferred constraint triggers and some
wierdness with functions) and can themselves throw an exception condition
so even barring internal problems, it's unsafe to assume that an exception
won't happen after your trigger runs.

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

Предыдущее
От: "Bruno BAGUETTE"
Дата:
Сообщение: RE : Postgreqsl & Package
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Timestamps in Views