Re: run function on server restart

From: "John D(dot) West" <john(dot)d(dot)west(at)asu(dot)edu>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: run function on server restart
Date: 2012-08-24 22:25:34
Message-ID: CACYo-=J0o+9tQM4fWhpM1_g_0nsMLvU+KdsGOqa+Ddb6DbYDrw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I *think* my independent processes are cleaning up in that they supposedly
abort themselves if they lose db connection, but on restart there is a
table of pid's I'd like to (1) make sure all of the processes are really
dead, killing any who aren't (2) reset flags in a table showing the status
of those process, and (3) clear out the pid list so I can restart the
processes.

Apparently the answer to my original question is "no, there is no way to
run a function at postgres startup." The question on monitoring apps
intrigues me, however. What can they do, and what is available?

Thanks!

-- John

On Fri, Aug 24, 2012 at 3:56 PM, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov
> wrote:

> "John D. West" <john(dot)d(dot)west(at)asu(dot)edu> wrote:
>
> > I have various background processes outside of postgres that need
> > to be killed and restarted after the server reboots.
>
> All of our applications are coded such that when they have an error
> on a database connection, they check for a serialization failure or
> a broken connection; if they find either they retry the database
> transaction. That would be my first recommendation. (Well, second,
> after identifying the causes of server crashes and fixing them.)
>
> Are you running any monitoring applications which could trigger what
> you want?
>
> -Kevin
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Angelico 2012-08-25 06:40:23 Re: run function on server restart
Previous Message Kevin Grittner 2012-08-24 21:56:34 Re: run function on server restart