Re: insert/update/delete returning and rules

From: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Jaime Casanova" <systemguards(at)gmail(dot)com>, "Pgsql Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: insert/update/delete returning and rules
Date: 2006-08-15 23:32:17
Message-ID: 36e682920608151632k1a90b31amf3c8dc539759b2f5@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 8/15/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> But even this seems like it would fail in complicated cases. What if
> the view is a join, and your ON INSERT rule inserts into two different
> underlying tables in two commands? If you need fields from both tables
> to generate a full RETURNING list then there's no apparent way to make
> it work.

As both methods have the same issue when dealing with complicated
(multi-table) inserts, updates, or deletes... I'm pondering how to
best combine the tuples in such a way as to generate a full RETURNING
list.

Maybe it's the flu talking, but is there some way to hack the
RETURNINGs into a subselect-like form such that we could combine the
multiple values returned from say 2 insert statements into a complete
RETURNING list in a single tuple?

--
Jonah H. Harris, Software Architect | phone: 732.331.1300
EnterpriseDB Corporation | fax: 732.331.1301
33 Wood Ave S, 2nd Floor | jharris(at)enterprisedb(dot)com
Iselin, New Jersey 08830 | http://www.enterprisedb.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2006-08-16 00:30:18 Re: [PATCHES] Custom variable class segmentation fault
Previous Message Larry Rosenman 2006-08-15 23:20:42 Re: BugTracker (Was: Re: 8.2 features status)