Re: BUG #2379: Duplicate pkeys in table

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2379: Duplicate pkeys in table
Date: 2006-04-06 16:20:21
Message-ID: 44353FC5.4050606@rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Oops. Minor change. Last two fields are updated by rules.

Tom Lane wrote:
> Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
>
>> 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
>>
>
> OK, that's a bit clearer. It'd help to see the view definition too.
>
Nothing special, just some 'fake' fields and no join (mainly there for
access control and compatibility across several applications):

SELECT
brokenTable.id,
brokenTable.someField1 AS someAlias1,
brokenTable."someField2"::character varying(64) AS someAlias2,
0::bigint AS someAlias3,
brokenTable.someField4,
'crypt'::character varying AS someAlias5,
brokenTable.fieldUpdatedByRule1,
brokenTable.fieldUpdatedByRule2
FROM brokenTable;

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2006-04-06 16:46:10 right sibling is not next child
Previous Message Philip Warner 2006-04-06 16:14:49 Re: BUG #2379: Duplicate pkeys in table