Re: BUG #2379: Duplicate pkeys in table
От | Tom Lane |
---|---|
Тема | Re: BUG #2379: Duplicate pkeys in table |
Дата | |
Msg-id | 24907.1144338689@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: BUG #2379: Duplicate pkeys in table (Philip Warner <pjw@rhyme.com.au>) |
Ответы |
Re: BUG #2379: Duplicate pkeys in table
Re: BUG #2379: Duplicate pkeys in table |
Список | pgsql-bugs |
Philip Warner <pjw@rhyme.com.au> 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
В списке pgsql-bugs по дате отправления: