rules ON INSERT

From: Ralph Heinkel <ralph(at)strubi(dot)ox(dot)ac(dot)uk>
To: pgsql-bugs(at)postgresql(dot)org
Subject: rules ON INSERT
Date: 2004-11-02 17:22:19
Message-ID: 200411021722.19226.ralph@strubi.ox.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-bugs by date

  From Date Subject
Next Message PostgreSQL Bugs List 2004-11-02 19:59:31 BUG #1304: update does not honor order of subselect
Previous Message Josh Berkus 2004-11-02 16:49:08 Re: [pgsql-bugs] Daily digest v1.1281 (14 messages)