FAQ

Philip Warner writes:
public | tg_update_qqq_date | "trigger"
mail | plpgsql |
Declare
uid bigint;
Begin
uid = (select owner_id from yyy m where m.f1 = NEW.f1);
if (uid <> 0 and not uid is null) then
update xxx set qqq_date = 'now' where id=uid;
end if;
Return NEW;
End; |
and there's also a rewrite rule:
zzz_update_r1 AS
ON UPDATE TO zzz DO INSTEAD UPDATE xxx SET f1 = new.f1
WHERE xxx.id = new.id
zzz_update_r2 AS
ON UPDATE TO zzz DO INSTEAD UPDATE xxx SET f2 = new.f2
WHERE xxx.id = new.id
OK, I'm a bit confused by the obfuscation here. The table with the
duplicates is xxx, or qqq? Which one is the trigger attached to?
zzz is a view I suppose?

regards, tom lane

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 13 of 21 | next ›
Discussion Overview
grouppgsql-bugs @
categoriespostgresql
postedApr 6, '06 at 6:29a
activeApr 7, '06 at 1:56a
posts21
users4
websitepostgresql.org
irc#postgresql

People

Translate

site design / logo © 2021 Grokbase