rules ON INSERT - Mailing list pgsql-bugs

From Ralph Heinkel
Subject rules ON INSERT
Date
Msg-id 200411021722.19226.ralph@strubi.ox.ac.uk
Whole thread Raw
List pgsql-bugs
Hi,

thanks to everybody who has answered to my question. Indeed the documents
let the programmer hope that s/he gets what should be expected:

In postgresql-7.4.1/doc/html/rules-update.html it says:
    For ON INSERT rules, the original query (if not suppressed by INSTEAD)
    is done before any actions added by rules. This allows the actions to
    see the inserted row(s).

The relevant part is "to see the inserted row(s)". This is really misleading
if in reality something else (like a macro as I've learned now) is executed.

My naive question is: Would it really be a lot of work in the postgres
code to actually return the results instead of executing the macro?
Then the postgres world would be simpler again and everybody could
just use rules without having so separate two cases:
1. Rules ON INSERT work without 'serials'
2. Rules ON INSERT don't work with 'serials', use triggers instead.

Thanks,

Ralph

pgsql-bugs by date:

Previous
From: "Laferriere, Al"
Date:
Subject: Re: 8.0 beta4: Exception when including catalog qualifier in SELECT from
Next
From: kael@canada.com
Date:
Subject: Possible bug: pg_hba.conf file