Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WKr3g-00037o-NS for pgsql-sql@arkaria.postgresql.org; Tue, 04 Mar 2014 15:15:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WKr3g-0008AC-1q for pgsql-sql@arkaria.postgresql.org; Tue, 04 Mar 2014 15:15:04 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WKr3f-000898-45 for pgsql-sql@postgresql.org; Tue, 04 Mar 2014 15:15:03 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WKr3c-0000m9-SG for pgsql-sql@postgresql.org; Tue, 04 Mar 2014 15:15:02 +0000 Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 81C04407; Tue, 4 Mar 2014 10:14:58 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Tue, 04 Mar 2014 10:14:58 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=u6weSFAFVcjeMB72/RwgimjhF7I=; b=Xk+//kZPjFqBo7/ZtRvY+hD2ONQQ 2bnaJKrFnGfMSkocgQNBXKh3T3NgM3Fl0gyye/O3H5Z8YtaVLYab6PLUwSmnhlPP uA8KwLKKys1WSsG8zy61P04piUd+ckcioZFtlKYy3bQeoQCs929RvoMZdXcbrBu2 P4ZriCcVlOZN9g0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=u6weSFAFVcjeMB72/Rwgim jhF7I=; b=hI3XVrmvBg9bPrbygSLyQKEwe8DBvZMSHRs/WadaJvREuB4X5S2jHK 1pCGShdXCE/kG/UnpfMdhNucWCyJn8vBnuzBzUlbgohkJ/KXsUpxDlTYMgPylZ2t S5CsC1Iho5cgLta3Mw0JwfZSnpjiJtoC6fhgCJsI5z3mGE4URddy4= X-Sasl-enc: 8vnpn4JPSkecXfdSfjxPwLEbFtVxW4G3W7wiHU89VEcp 1393946097 Received: from panda.site (unknown [97.113.11.16]) by mail.messagingengine.com (Postfix) with ESMTPA id 8C7336800E7; Tue, 4 Mar 2014 10:14:57 -0500 (EST) Message-ID: <5315EDF0.1020600@aklaver.com> Date: Tue, 04 Mar 2014 07:14:56 -0800 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: ALMA TAHIR , Tom Lane CC: "pgsql-sql@postgresql.org" Subject: Re: Function Issue References: <1393503792.47079.YahooMailNeo@web192706.mail.sg3.yahoo.com> <30402.1393511579@sss.pgh.pa.us> <1393593190.2407.YahooMailNeo@web192706.mail.sg3.yahoo.com> <1393846322.42246.YahooMailNeo@web192703.mail.sg3.yahoo.com> In-Reply-To: <1393846322.42246.YahooMailNeo@web192703.mail.sg3.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On 03/03/2014 03:32 AM, ALMA TAHIR wrote: > Hi, > > I am using below code in multi threaded environment, but when multiple > threads are accessing then i get : "org.postgresql.util.PSQLException: > ERROR: tuple concurrently updated" exception. But my concern is I need > to use it in multi threaded env, for the same reason I am using FOR > UPDATE with cursor. Then where is the issue??? Am I missing > something????? Please help me with the same..... I will say up front I am wandering out of my depth, but here it goes. I researched the above error message and it always seems to lead back to issue with a system catalog tuple getting concurrent updates. So, are we seeing all the queries that are happening when you run the function? In other words is there anything that touches a system catalog, say an ANALYZE? Are you sure your threads are using separate transactions and are not tromping over each other? What does the Postgres log show around the error message? > > > > > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql