Обсуждение: fire trigger for a row without update?

Поиск
Список
Период
Сортировка

fire trigger for a row without update?

От
Gerhard Heift
Дата:
Hello,

is it possible to call a trigger for a row in a table without updating the
row? I want to do it in plpgsql.

Something like UPDATE table WHERE id = 10;
or PERFORM table.trigger('UPDATE', row) WHERE id = 10;

Regards,
  Gerhard

Вложения

Re: fire trigger for a row without update?

От
"Albe Laurenz"
Дата:
Gerhard Heift wrote:
> is it possible to call a trigger for a row in a table without updating
the
> row? I want to do it in plpgsql.
>
> Something like UPDATE table WHERE id = 10;
> or PERFORM table.trigger('UPDATE', row) WHERE id = 10;

Think twice if you really need that - it sounds a little odd.

But you could do:

UPDATE tab SET id = 10 WHERE id = 10;

or something similar. This would of course create a new row version, but
it would do what you want.

Yours,
Laurenz Albe