Mark Lubratt <mark.lubratt@indeq.com> writes:
> The deletes look something like
> delete from CL where CL_id = i
> where i could be a list of several hundred integers. Again, right now
> I iterate through the list.
Consider
delete from CL where CL_id in (i,j,k,...);
If you have hundreds of target values, it might be better to put them in
a temp table and go
delete from CL where CL_id in (select id from temp_table);
The latter should be reasonably quick in 7.4, but be warned that it'll
suck in prior releases.
> MySQL has a multiple insert feature where you simply append a bunch of
> (j, k)'s separated by a comma. Does PostgreSQL have anything like
> this?
That is SQL-spec syntax, but we've not gotten around to implementing it.
COPY is a lot faster for bulk inserts.
> I was hoping I might be able to use COPY, but I see that's
> really only for psql.
Huh? You can use COPY FROM STDIN in most of our client libraries,
certainly so with libpq. What are you using?
regards, tom lane