pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Spiegelberg, Greg <gspiegelberg@cranel.com>
To: Bruno Wolff III <bruno@wolff.to>
To: Ricardo Valença de Assis <valenca@campusvirtual.br>
Cc: pgsql-admin@postgresql.org
Subject: Re: delete to slow
Date: Thu, 21 Apr 2005 09:09:06 -0400
Message-ID: <82E74D266CB9B44390D3CCE44A781ED9070C90@POSTOFFICE.cranel.local> (raw)

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@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Bruno Wolff III
Sent: Wednesday, April 06, 2005 1:32 PM
To: Ricardo Valença de Assis
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] delete to slow

On Wed, Apr 06, 2005 at 13:45:13 -0300,
  Ricardo Valença de Assis <valenca@campusvirtual.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@postgresql.org)



view thread (18+ messages)  latest in thread

Message-ID: <82E74D266CB9B44390D3CCE44A781ED9070C90@POSTOFFICE.cranel.local>
Permalink:  ../82E74D266CB9B44390D3CCE44A781ED9070C90@POSTOFFICE.cranel.local/
Also on:    postgresql.org/message-id/82E74D266CB9B44390D3CCE44A781ED9070C90@POSTOFFICE.cranel.local

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: gspiegelberg@cranel.com, bruno@wolff.to, valenca@campusvirtual.br
  Subject: Re: delete to slow
  In-Reply-To: <82E74D266CB9B44390D3CCE44A781ED9070C90@POSTOFFICE.cranel.local>
  References: <82E74D266CB9B44390D3CCE44A781ED9070C90@POSTOFFICE.cranel.local>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox