From: | "Spiegelberg, Greg" <gspiegelberg(at)cranel(dot)com> |
---|---|
To: | "Bruno Wolff III" <bruno(at)wolff(dot)to>, Ricardo Valença de Assis <valenca(at)campusvirtual(dot)br> |
Cc: | <pgsql-admin(at)postgresql(dot)org> |
Subject: | Re: delete to slow |
Date: | 2005-04-21 13:09:06 |
Message-ID: | 82E74D266CB9B44390D3CCE44A781ED9070C90@POSTOFFICE.cranel.local |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Catching up on my email.
Would it be possible to perform a DELETE FROM table WHERE CURRENT OF mycursor?
Is this implemented in Postgres? I'm not seeing in in the manual for 7.4 or 8.
Greg
-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org [mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Bruno Wolff III
Sent: Wednesday, April 06, 2005 1:32 PM
To: Ricardo Valença de Assis
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] delete to slow
On Wed, Apr 06, 2005 at 13:45:13 -0300,
Ricardo Valença de Assis <valenca(at)campusvirtual(dot)br> wrote:
> Hello Everybody!
>
> I´m trying to use delete to remove data from one table based on another. The query is this:
>
> DELETE FROM table1 WHERE column1 IN (SELECT column2 FROM table2);
>
> but my table is big, so it takes a lot o time...
> Is there a way to use DELETE with INNER JOIN in PostGreSQL?
Yes. You should be able to do something like:
DELETE FROM table1 WHERE column1 = table2.column2;
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
From | Date | Subject | |
---|---|---|---|
Next Message | syed magthum | 2005-04-21 13:32:13 | Product Suggestions |
Previous Message | Wim Bertels | 2005-04-21 11:03:44 | Re: brute force attacking the password |