On Fri, Oct 5, 2012 at 12:46 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> FOR c IN SELECT ctid FROM table WHERE ... ORDER BY ... LOOP
> DELETE FROM table WHERE ctid = c;
> END LOOP;
Maybe, in that sense, it would be better to optimize client-server
protocol for batch operations.
PREPARE blah(c) AS DELETE FROM table WHERE ctid = $1;
EXECUTE blah(c1), blah(c2), blah(c3), ...
^ 1 transaction, 1 roundtrip, multiple queries