one more word about rules
От | Papp Gyozo |
---|---|
Тема | one more word about rules |
Дата | |
Msg-id | Pine.GSO.4.21.0009221329370.6305-100000@ural2 обсуждение исходный текст |
Ответ на | Re: rule with multiple DELETE action part (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: one more word about rules
|
Список | pgsql-general |
First, thank youu for the accurate and exhausting answer. And a new idea... I've encountered a problem and I think rules would be the nicest and the best solutions for it. After SELECTing rows I need to update some statistic fields such as timestamp of last reference and number of all references up to now, etc. In pgsql 7.0.2, there is no way to create a rule which can perform an additional query after SELECT. What I'm writing about: CREATE RULE r_my_dream AS ON SELECT TO xxx DO UPDATE xxx SET c_lastref = current_timestamp, c_refnum = c_refnum + 1 WHERE xxx.oid = old.oid; I know that this could be solved with FOR UPDATE clause and then with an UPDATE query. But, it would be so nice if it was totally transparent. (_only_one_ query) Can my dream be realised? Papp Gyozo s7461pap@hszk.bme.hu, gerzson17@freemail.hu
В списке pgsql-general по дате отправления: