Re: column: on update update?

Поиск
Список
Период
Сортировка
От Michael Monnerie
Тема Re: column: on update update?
Дата
Msg-id 200805071649.03336@zmi.at
обсуждение исходный текст
Ответ на Re: column: on update update?  ("Richard Broersma" <richard.broersma@gmail.com>)
Ответы Re: column: on update update?  (CZUCZY Gergely <gergely.czuczy@harmless.hu>)
Список pgsql-admin
On Mittwoch, 7. Mai 2008 Richard Broersma wrote:
> Well you have two options.  The perferred method would be to have
> your application include an update to your lastupdate field whenever
> anyother rows are updated.

But as we speak about SpamAssassin, an external project, I do not want
to patch every new version that comes out. Maybe they include it once,
but it isn't currently so I need the db do it.

> the other option is to add an after update trigger, and manually set
> lastupdate then.

Would that be correct? I never did it and looked purely into docs:

CREATE FUNCTION awlupdate()
    AS 'UPDATE awl SET lastupdate=CURRENT_TIMESTAMP;'
    LANGUAGE SQL;

CREATE TRIGGER awlupdate AFTER UPDATE ON awl FOR EACH ROW
EXECUTE PROCEDURE awlupdate();

mfg zmi
--
// Michael Monnerie, Ing.BSc    -----      http://it-management.at
// Tel: 0676/846 914 666                      .network.your.ideas.
// PGP Key:         "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: AC19 F9D5 36ED CD8A EF38  500E CE14 91F7 1C12 09B4
// Keyserver: www.keyserver.net                   Key-ID: 1C1209B4

Вложения

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

Предыдущее
От: Michael Monnerie
Дата:
Сообщение: Re: duplicate primary index in bayes db from SpamAssassin
Следующее
От: bryan castillo
Дата:
Сообщение: How do I view the parameters of a running query?