From: | Philip Warner <pjw(at)rhyme(dot)com(dot)au> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Subject: | Re: BUG #2379: Duplicate pkeys in table |
Date: | 2006-04-06 16:04:51 |
Message-ID: | 44353C23.4080503@rhyme.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Tom Lane wrote:
> OK, I'm a bit confused by the obfuscation here. The table with the
> duplicates is xxx, or qqq?
Possibly less obscure version:
public | tg_update_anotherTable_date | "trigger"
| | mail | plpgsql |
Declare
uid bigint;
Begin
uid = (select owner_id from anotherNotherTable m where
m.keyField = NEW.fkField);
if (uid <> 0 and not uid is null) then
update brokenTable set some_date = 'now' where id=uid;
end if;
Return NEW;
End; |
and there's also a rewrite rule:
aView_update_r1 AS
ON UPDATE TO aView DO INSTEAD UPDATE brokenTable SET f1 = new.f1
WHERE brokenTable.id = new.id
aView_update_r2 AS
ON UPDATE TO aView DO INSTEAD UPDATE brokenTable SET f2 = new.f2
WHERE brokenTable.id = new.id
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2006-04-06 16:07:08 | Re: BUG #2379: Duplicate pkeys in table |
Previous Message | Philip Warner | 2006-04-06 16:01:42 | Re: BUG #2379: Duplicate pkeys in table |