Re: BUG #2379: Duplicate pkeys in table - Mailing list pgsql-bugs

From Philip Warner
Subject Re: BUG #2379: Duplicate pkeys in table
Date
Msg-id 44353E79.4040100@rhyme.com.au
Whole thread Raw
In response to Re: BUG #2379: Duplicate pkeys in table  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Tom Lane wrote:
> Philip Warner <pjw@rhyme.com.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.fieldUpdatedByTrigger,
    brokenTable.fieldUpdatedByRule1
   FROM brokenTable;

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #2379: Duplicate pkeys in table
Next
From: Philip Warner
Date:
Subject: Re: BUG #2379: Duplicate pkeys in table