Re: Bug in PL/pgSQL GET DIAGNOSTICS? - Mailing list pgsql-hackers

From Manfred Koizar
Subject Re: Bug in PL/pgSQL GET DIAGNOSTICS?
Date
Msg-id 3d3cpusfk97kpk9idglerikktgfb43m15g@4ax.com
Whole thread Raw
In response to Re: Bug in PL/pgSQL GET DIAGNOSTICS?  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Bug in PL/pgSQL GET DIAGNOSTICS?  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
On Sat, 28 Sep 2002 13:41:04 -0400 (EDT), Bruce Momjian
<pgman@candle.pha.pa.us> wrote:
>Does anyone else have a common rule that would return incorrect results
>using the proposed rules?
CREATE VIEW twotables ASSELECT ... FROM table1 INNER JOIN table2 ON ... ;
CREATE RULE twotables_insert AS     -- INSERT ruleON INSERT TO twotables DO INSTEAD (    INSERT INTO table1 VALUES
(new.pk,new.col1);    INSERT INTO table2 VALUES (new.pk, new.col2)); CREATE RULE twotables_update AS     -- UPDATE
ruleONUPDATE TO twotables DO INSTEAD (    UPDATE table1 SET col1 = new.col1 WHERE pk = old.pk;    UPDATE table2 SET
col2= new.col2 WHERE pk = old.pk); CREATE RULE twotables_delete AS     -- DELETE ruleON DELETE TO twotables DO INSTEAD
(   DELETE FROM table1 WHERE pk = old.pk;    DELETE FROM table2 WHERE pk = old.pk);
 
CREATE VIEW visible ASSELECT ... FROM table3WHERE deleted = 0;
CREATE RULE visible_delete AS     -- DELETE ruleON DELETE TO visible DO INSTEAD     UPDATE table3    SET deleted = 1
WHEREpk = old.pk;
 

ServusManfred


pgsql-hackers by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: v7.3 Branched ...
Next
From: Tom Lane
Date:
Subject: Re: [PATCHES] Cascaded Column Drop