Skip site navigation (1) Skip section navigation (2)

Expanding DELETE/UPDATE returning

From: Rusty Conover <rconover(at)infogears(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Expanding DELETE/UPDATE returning
Date: 2007-02-27 03:24:20
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

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 =  
returning, t1.location_id;

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

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


Rusty Conover
InfoGears Inc.


pgsql-hackers by date

Next:From: Tom LaneDate: 2007-02-27 03:26:40
Subject: Re: autovacuum next steps, take 2
Previous:From: John BartlettDate: 2007-02-27 03:23:17

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group