Re: Listen and do something daemon - Mailing list pgsql-general

From Josh Kupershmidt
Subject Re: Listen and do something daemon
Date
Msg-id AANLkTin+hNCJUY_GcRY++SirAt9UgzMfTWBodu5k0rR3@mail.gmail.com
Whole thread Raw
In response to Listen and do something daemon  (KM <km@xacrasis.netx>)
List pgsql-general
On Fri, Sep 24, 2010 at 9:42 PM, KM <km@xacrasis.netx> wrote:
> Does this program already exist?
>
>   $ listen-and-do --database=foo --listen-for="somenotification" \
>      --then-do="some-script"
>
> It will daemonize itself, issue a 'LISTEN somenotification' on the
> database foo, and on each NOTIFY will run some-script.

I think the "libpq Example Program 2" could be very easily adapted for this:
http://www.postgresql.org/docs/current/static/libpq-example.html

Josh

pgsql-general by date:

Previous
From: Andre Lopes
Date:
Subject: Re: How to use pg_restore with *.sql file?
Next
From: Tom Lane
Date:
Subject: Re: psql copy command - 1 char limitation on delimiter