Using results from RETURNING - Mailing list pgsql-general

From Shak
Subject Using results from RETURNING
Date
Msg-id h00ri7$1t2h$1@news.hub.org
Whole thread Raw
Responses Re: Using results from RETURNING
List 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


pgsql-general by date:

Previous
From: "Shak"
Date:
Subject: Using results from DELETE ... RETURNING
Next
From: Grzegorz Jaśkiewicz
Date:
Subject: Re: Schema, database, or tables in different folders?