Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 7853F9FA333 for ; Mon, 9 Oct 2006 19:00:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 52195-01 for ; Mon, 9 Oct 2006 19:00:41 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from tomts13-srv.bellnexxia.net (tomts13.bellnexxia.net [209.226.175.34]) by postgresql.org (Postfix) with ESMTP id 77F7C9FB26C for ; Mon, 9 Oct 2006 19:00:40 -0300 (ADT) Received: from acer.sympatico.ca ([65.95.172.91]) by tomts13-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20061009220038.TJWH29052.tomts13-srv.bellnexxia.net@acer.sympatico.ca> for ; Mon, 9 Oct 2006 18:00:38 -0400 Message-Id: <5.2.1.1.0.20061009175632.057feec0@pop6.sympatico.ca> X-Sender: b1wudu74@pop6.sympatico.ca X-Mailer: QUALCOMM Windows Eudora Version 5.2.1 Date: Mon, 09 Oct 2006 18:00:33 -0400 To: pgsql-sql@postgresql.org From: Frank Bax Subject: Re: deleting rows in specific order In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.134 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/97 X-Sequence-Number: 26486 At 04:14 PM 10/9/06, Daniel Drotos wrote: >What is the best way to do something like: > >delete from tablename where something order by somefield... You cannot, because it doesn't make sense. The "order by" clause is not valid on delete statement. Queries from other processes that start while your delete is running will either see all the deleted rows or (perhaps) they will see none of them.