Re: Using results from DELETE ... RETURNING

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Fetter <david(at)fetter(dot)org>, Joshua Tolley <eggyknap(at)gmail(dot)com>, Shak <sshaikh(at)hotmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Using results from DELETE ... RETURNING
Date: 2009-06-08 13:18:19
Message-ID: b42b73150906080618m34c996cak8a2f0b6592f9ebc3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Sun, Jun 7, 2009 at 12:29 AM, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> David Fetter <david(at)fetter(dot)org> writes:
>> Would it be super-complicated to do this with CTEs for 8.5?  They seem to
>> have sane properties like getting executed exactly once.
>
> Hmm, interesting thought.  The knock against doing RETURNING as an
> ordinary subquery is exactly that you can't disentangle it very well
> from the upper query (and thus, it's hard to figure out when to fire
> triggers, to take just one problem).  But we've defined CTEs much more
> restrictively, so maybe the problems can be solved in that context.
>

being able to do this would probably give 'best of class' approach to
dealing with update/insert rules to views that want to work
w/returning clause (although, still a complete mess), plus numerous
other useful things.

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2009-06-08 13:19:23 Re: limit table to one row
Previous Message Kevin Field 2009-06-08 12:55:09 Re: trigger functions with arguments

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-06-08 13:47:38 Re: postmaster recovery and automatic restart suppression
Previous Message Merlin Moncure 2009-06-08 13:10:11 Re: pg_migrator issue with contrib