On Sun, Jun 7, 2009 at 12:29 AM, Tom Lane wrote:
> David Fetter 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 subquer
David Fetter 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
On Fri, Jun 05, 2009 at 07:13:43PM -0400, Tom Lane wrote:
> Merlin Moncure writes:
> > On Fri, Jun 5, 2009 at 6:51 PM, Tom Lane wrote:
> >> I think you can loop over the results in plpgsql, for instance
>
> > also sql functions can direct 'returning' results directly to the
> > return of the func
Merlin Moncure writes:
> On Fri, Jun 5, 2009 at 6:51 PM, Tom Lane wrote:
>> I think you can loop over the results in plpgsql, for instance
> also sql functions can direct 'returning' results directly to the
> return of the function (at least in 8.4).
That bit is new in 8.4, which is why I didn't
On Fri, Jun 5, 2009 at 6:51 PM, Tom Lane wrote:
> Joshua Tolley writes:
>> On Mon, Jun 01, 2009 at 04:21:27PM +0100, Shak wrote:
>>> Something like:
>>> SELECT COUNT(*) FROM (DELETE FROM a RETURNING *) ;
>>> sounds reasonable but results in a syntax error. I am able to return single
>>> results in
Joshua Tolley writes:
> On Mon, Jun 01, 2009 at 04:21:27PM +0100, Shak wrote:
>> Something like:
>> SELECT COUNT(*) FROM (DELETE FROM a RETURNING *) ;
>> sounds reasonable but results in a syntax error. I am able to return single
>> results into a variable or record, but not more than one result.
On Mon, Jun 01, 2009 at 04:21:27PM +0100, Shak wrote:
> When RETURNING from a DELETE statement (or similar), how do you access the
> results being returned?
>
> Something like:
>
> SELECT COUNT(*) FROM (DELETE FROM a RETURNING *) ;
>
> sounds reasonable but results in a syntax error. I am able to r
Hi all,
When RETURNING from a DELETE statement (or similar), how do you access the
results being returned?
Something like:
SELECT COUNT(*) FROM (DELETE FROM a RETURNING *) ;
sounds reasonable but results in a syntax error. I am able to return single
results into a variable or record, but not m