Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YFput-0003GK-34 for pgsql-general@arkaria.postgresql.org; Mon, 26 Jan 2015 20:05:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YFpur-0004A3-NP for pgsql-general@arkaria.postgresql.org; Mon, 26 Jan 2015 20:05:45 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YFpue-0003mU-NC for pgsql-general@postgresql.org; Mon, 26 Jan 2015 20:05:32 +0000 Received: from squeakycode.net ([96.126.114.205]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YFpuY-0007Q7-It for pgsql-general@postgresql.org; Mon, 26 Jan 2015 20:05:28 +0000 Received: from [192.168.10.81] (74-84-91-123.client.mchsi.com [74.84.91.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: andy) by squeakycode.net (Postfix) with ESMTPSA id E31EF222F9 for ; Mon, 26 Jan 2015 14:05:25 -0600 (CST) Message-ID: <54C69DF3.1060305@squeakycode.net> Date: Mon, 26 Jan 2015 14:05:07 -0600 From: Andy Colson User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Re: check if the same function is already running, then exit! References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 1/26/2015 1:58 PM, Suresh Raja wrote: > Before running a running a function, i would check only 1 instance is > running. If alreaady a function is running, the existing function > should exist with the msg that already a function with same is running. > > If somebody has already used such a faeture, can u please share or > Can you tell me the table and column from which I could this info. > > Thanks, Advisory locks might work for you: http://www.postgresql.org/docs/9.4/static/explicit-locking.html (at the bottom of the page) google will find other's talking about it: "postgres advisory lock" -Andy -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general