Fwd: [GENERAL] Problem with CREATE RULE <something> ON DELETE (PostgreSQL only executes the first expression)

From: "J(dot) Roeleveld" <j(dot)roeleveld(at)softhome(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Fwd: [GENERAL] Problem with CREATE RULE <something> ON DELETE (PostgreSQL only executes the first expression)
Date: 1999-11-23 19:57:40
Message-ID: 4.1.19991123205210.00924b20@pop.softhome.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I'm reposting it here, since i haven't received any help after posting it
at the general
mailing-list, and sending in a bug-report at the bugs mailing-list.

I'm willing to forward the bug-report to any email-adress I'm asked for to
sent it to,
but since it's a long one (contains a full script to reproduce this error)
I'm a bit reluctant
to do so.

Joost Roeleveld

=========== Forwarded Message follows ==========
Hi,

I have found what appears to be a bug in PostgreSQL, or is this a feature?
I don't think it's a feature, because the postgreSQL documentation state it
should work.

When creating delete-rules for views, i have found that only the first
expression is being executed, when
using multiple expressions.

I have managed to do this for Insert, and i think for Update as well...
although i haven't gotten around to testing that yet.

The following is the RULE-definition I use, it's for a View (
bedrijven_view ) which consists of
two tables ( adressen_table and bedrijven_table ).
When I change the sequence (eg. put the delete from bedrijven_table first)
it still only does the first statement.

CREATE RULE delete_bedrijven_view AS ON DELETE
TO bedrijven_view
DO INSTEAD (
DELETE FROM adressen_table
WHERE adres_id = get_adres_nummer(straatnaam,
huisnummer,postcode,land);
DELETE FROM bedrijven_table
WHERE firma_id = firma_id;
);

If you require more information, for instance a full list of statements
that can reproduce the problem,
please let me know, and I'll forward the bug-report I sent in yesterday
morning.

with kind regards,

Joost Roeleveld

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-11-23 19:58:47 Re: AW: [HACKERS] Getting OID in psql of recent insert
Previous Message Vince Vielhaber 1999-11-23 19:57:05 RE: AW: [HACKERS] SQL statements: begin and end