agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedcheck if the same function is already running, then exit!
3+ messages / 3 participants
[nested] [flat]
* check if the same function is already running, then exit!
@ 2015-01-26 19:58 Suresh Raja <suresh.rajaabc@gmail.com>
2015-01-26 20:01 ` Re: check if the same function is already running, then exit! Pavel Stehule <pavel.stehule@gmail.com>
2015-01-26 20:05 ` Re: check if the same function is already running, then exit! Andy Colson <andy@squeakycode.net>
0 siblings, 2 replies; 3+ messages in thread
From: Suresh Raja @ 2015-01-26 19:58 UTC (permalink / raw)
To: pgsql-general@postgresql.org; pgsql-sql
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,
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: check if the same function is already running, then exit!
2015-01-26 19:58 check if the same function is already running, then exit! Suresh Raja <suresh.rajaabc@gmail.com>
@ 2015-01-26 20:01 ` Pavel Stehule <pavel.stehule@gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: Pavel Stehule @ 2015-01-26 20:01 UTC (permalink / raw)
To: Suresh Raja <suresh.rajaabc@gmail.com>; +Cc: " <pgsql-general@postgresql.org>; pgsql-sql
Hi
you can use a advisory locks for singleton implementation
http://www.postgresql.org/docs/9.4/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS
Regards
Pavel
2015-01-26 20:58 GMT+01:00 Suresh Raja <suresh.rajaabc@gmail.com>:
> 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,
>
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: check if the same function is already running, then exit!
2015-01-26 19:58 check if the same function is already running, then exit! Suresh Raja <suresh.rajaabc@gmail.com>
@ 2015-01-26 20:05 ` Andy Colson <andy@squeakycode.net>
1 sibling, 0 replies; 3+ messages in thread
From: Andy Colson @ 2015-01-26 20:05 UTC (permalink / raw)
To: pgsql-general@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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2015-01-26 20:05 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-01-26 19:58 check if the same function is already running, then exit! Suresh Raja <suresh.rajaabc@gmail.com>
2015-01-26 20:01 ` Pavel Stehule <pavel.stehule@gmail.com>
2015-01-26 20:05 ` Andy Colson <andy@squeakycode.net>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox