agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Andy Colson <andy@squeakycode.net>
To: pgsql-general@postgresql.org
Subject: Re: check if the same function is already running, then exit!
Date: Mon, 26 Jan 2015 14:05:07 -0600
Message-ID: <54C69DF3.1060305@squeakycode.net> (raw)
In-Reply-To: <CAJP7dtCgtdFvAKLmbP52u51HyVXqbxgkHQR+6yrKPcrhcpViRg@mail.gmail.com>
References: <CAJP7dtCgtdFvAKLmbP52u51HyVXqbxgkHQR+6yrKPcrhcpViRg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

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



view thread (3+ messages)

Message-ID: <54C69DF3.1060305@squeakycode.net>
Permalink:  ../54C69DF3.1060305@squeakycode.net/
Also on:    postgresql.org/message-id/54C69DF3.1060305@squeakycode.net

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: andy@squeakycode.net, pgsql-general@postgresql.org
  Subject: Re: check if the same function is already running, then exit!
  In-Reply-To: <54C69DF3.1060305@squeakycode.net>

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

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