Re: check if the same function is already running, then exit!

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Suresh Raja <suresh(dot)rajaabc(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>, postgres list <pgsql-sql(at)postgresql(dot)org>
Subject: Re: check if the same function is already running, then exit!
Date: 2015-01-26 20:01:48
Message-ID: CAFj8pRBQe6zcmnXpbB0wmVyGR4NDZ5j06Bi9z6j=93wSBGHSug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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(dot)rajaabc(at)gmail(dot)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,
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2015-01-26 20:03:01 Re: How to access large objects in Postgresql c-language functions?
Previous Message John R Pierce 2015-01-26 20:01:04 Re: How to access large objects in Postgresql c-language functions?

Browse pgsql-sql by date

  From Date Subject
Next Message Andy Colson 2015-01-26 20:05:07 Re: check if the same function is already running, then exit!
Previous Message Suresh Raja 2015-01-26 19:58:01 check if the same function is already running, then exit!