Expanding DELETE/UPDATE returning - Mailing list pgsql-hackers

From Rusty Conover
Subject Expanding DELETE/UPDATE returning
Date
Msg-id D1ABEDFA-66AB-49FD-BE78-4C25E52709ED@infogears.com
Whole thread Raw
Responses Re: Expanding DELETE/UPDATE returning  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

I didn't see this on the TODO list, but if it is my apologies.  Is it in the cards to expand the functionality of DELETE/UPDATE returning to be able to sort the output of the rows returned?  Or allow delete and update to be used in sub-queries?

Some examples:

create temp table t1 (id integer, location_id integer);
insert into t1 values(1, 1);
insert into t1 values(2, 1);
insert into t1 values(3, 1);
insert into t1 values(1, 3);

create temp table search_requests (id integer);
insert into search_requests values(1);
insert into search_requests values(3);

-- This works
delete from search_requests using t1 where t1.id = search_requests.id returning t1.id, t1.location_id;

-- This does not work.
delete from search_requests using t1 where t1.id = search_requests.id returning t1.id, t1.location_id order by t1.location_id desc;

-- This does not work.
select foo.id, count(*) from (delete from search_requests using t1 where t1.id = search_requests.id returning t1.id, t1.location_id) as foo group by foo.id;

Thanks,

Rusty
--
Rusty Conover
InfoGears Inc.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: autovacuum next steps, take 2
Next
From: Tom Lane
Date:
Subject: Re: autovacuum next steps, take 2