Using results from RETURNING

From: "Shak" <Shak(at)shak(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Using results from RETURNING
Date: 2009-06-01 15:18:36
Message-ID: h00ri7$1t2h$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 more than one result.

I could use a SELECT ... FOR UPDATE in the meantime, I just wanted to know
what the use of RETURNING * was if you can't do anything with the results.

Thanks!

Shak

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shak 2009-06-01 15:21:27 Using results from DELETE ... RETURNING
Previous Message Tom Lane 2009-06-01 14:27:03 Re: pg_dump & table space