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

Re: DELETE with JOIN

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: felix(at)crowfix(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: DELETE with JOIN
Date: 2008-08-07 19:58:51
Message-ID: 26509.1218139131@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-sql
felix(at)crowfix(dot)com writes:
> I have tried to do this before and always found a way, usually

>     DELETE FROM a WHERE a.b_id IN (SELECT id FROM b WHERE second_id = ?)

> but I have too many rows, millions, in the IN crowd, ha ha, and it
> barfs.

Define "barfs".  That seems like the standard way to do it, and it
should work.

			regards, tom lane

In response to

Responses

pgsql-sql by date

Next:From: Frank BaxDate: 2008-08-07 20:01:29
Subject: Re: DELETE with JOIN
Previous:From: felixDate: 2008-08-07 19:12:07
Subject: Re: DELETE with JOIN

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