X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id F2D7D475D0F for ; Thu, 10 Apr 2003 00:41:43 -0400 (EDT) Received: from rtlocal.trade-india.com (mail-relay.trade-india.com [203.196.129.235]) by postgresql.org (Postfix) with SMTP id C0AB7475EDF for ; Thu, 10 Apr 2003 00:41:05 -0400 (EDT) Received: (qmail 13360 invoked from network); 10 Apr 2003 04:43:14 -0000 Received: from system67.trade-india-local.com (192.168.0.67) by infocom-236-129-del.trade-india.com with SMTP; 10 Apr 2003 04:43:14 -0000 From: Rajesh Kumar Mallah Organization: Infocom Network Limited To: Tom Lane Subject: Re: question about visibilty while updating multiple rows . Date: Thu, 10 Apr 2003 10:11:19 +0530 User-Agent: KMail/1.5 Cc: pgsql-sql@postgresql.org References: <200304091247.59378.mallah@trade-india.com> <7045.1049901168@sss.pgh.pa.us> In-Reply-To: <7045.1049901168@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200304101011.20087.mallah@trade-india.com> X-Spam-Status: No, hits=-33.7 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, QUOTE_TWICE_1,REFERENCES,REPLY_WITH_QUOTES, SIGNATURE_SHORT_SPARSE,USER_AGENT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/150 X-Sequence-Number: 12851 On Wednesday 09 Apr 2003 8:42 pm, Tom Lane wrote: > > If an update statement is affecting multiple rows of a table X , > > Does a subselect (selecting from X only) inside EXISTS part of outer > > query able to see the changes when rows are being updated one by one by > > outer query? > > No, because it's part of the same query. > > I believe though that a user-defined function called from the update > query would see the changes made so far. So possibly you can fix your > problem by pushing the EXISTS down into a SQL or plpgsql function. Thanks for the explanation and suggestion Tom, I did it however by using intermediate tables and distinct on(). Regds Mallah. > > regards, tom lane > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly -- Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New Delhi phone: +91(11)6152172 (221) (L) ,9811255597 (M) Visit http://www.trade-india.com , India's Leading B2B eMarketplace.