Search Postgresql Archives

Re: Alarm function in PL/pgSQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jon Smark wrote:
I don't think this is really possible with postgres PLs generally.
Typically what you have to do is have a function that is called on an
interval that checks for alarms and runs them.

Thanks for the prompt reply.  Just to clarify: you are saying that the
function that is called with a given periodicity must be so from *outside*
PG, ie, from the client application, right?  I mean, there is no way
strictly internal to PG to have a function be called every given number
of seconds?

You should lookup Postgres' LISTEN and NOTIFY feature, and see if that is useful in doing what you want. For example, if this is possible, have a database-transaction-external task running which is LISTENing for your state setting signal, and then it waits for an hour and then calls the function. Your first function would send the NOTIFY signal. -- Darren Duncan

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux