Re: Using results from DELETE ... RETURNING - Mailing list pgsql-general

From Joshua Tolley
Subject Re: Using results from DELETE ... RETURNING
Date
Msg-id 20090605214533.GB442@eddie
Whole thread Raw
In response to Using results from DELETE ... RETURNING  ("Shak" <sshaikh@hotmail.com>)
Responses Re: Using results from DELETE ... RETURNING
List pgsql-general
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 return single
> results into a variable or record, but not more than one result.

You can't. It's on the TODO list (http://wiki.postgresql.org/wiki/Todo). Look
for "Allow INSERT/UPDATE ... RETURNING" and "Allow INSERT ... DELETE ... RETURNING"

- Josh / eggyknap

Attachment

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: why dropping a trigger may cause a deadlock
Next
From: Tom Lane
Date:
Subject: Re: Using results from DELETE ... RETURNING