Re: Looking for auto starting procedures - Mailing list pgsql-general

From
Subject Re: Looking for auto starting procedures
Date
Msg-id !&!AAAAAAAAAAAYAAAAAAAAAOb5xiPoTM8RjQUAgEiElinCgAAAEAAAACJetM2PI3NLjisBFDoJICYBAAAAAA==@manfbraun.de
Whole thread Raw
In response to Re: Looking for auto starting procedures  (Cédric Villemain <cedric.villemain.debian@gmail.com>)
List pgsql-general
Hello !

With server start, I mean the start of the postgresql engine, not the
machine itself.
I thought about a stored procedure to come into a LISTEN in a loop, but the
loop
must be started anyway [avoid a separate daemon {now, I know, I can use a
pgsql script}].

LISTEN looks great to me [not tried yet]. Thanks for the pointers, I have
yet not
heard about PGQ and it looks like something I missed on Sql Server! Will
study
this!

For logging:I think, I have all rights, but not postgresql configured to
log to syslog.

Much thanks!

br++mabra

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Cédric Villemain
Sent: Saturday, December 04, 2010 3:12 PM
To: mabra@manfbraun.de
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Looking for auto starting procedures

2010/12/2  <mabra@manfbraun.de>:
> Hello !
>
> And thanks to all, for answers.
>
> Naturally, cron does not operate on DB tables and if I add/remove/change
> a line in a control table dynamically, cron would not notice that ;-)
> So I had to write a daemon, which acts on that table. This might happen
> about ~5 - 20 seconds and cron is operates on minutes only.

Perhaps you are trying to solve something with SQL server behavior and
you may find more interesting ways "à la PostgreSQL".

I wonder if you are not looking after something like PgQ[1] or LISTEN/NOTIFY
[2]

>
> An auto running stored procedure would solve the problem, if therewould be
> a way to run this procedure on server startup automatically
> [as it looks, write another daemon for this].

on server start ?! no daemon is necesary.

>
> The usual notification from postgreSQL does not allow to write
> an [own, better to evaluate] identifier in the syslog. This is
> not a matter of the syslog daemon, its on the program which logs.
> May be, I have just not found this.

Maybe you need to adjust your 'roles' [3] so that log lines can be
identified to your role.

Maybe you'll have better answers if you define your objectives.


[1] http://wiki.postgresql.org/wiki/PGQ_Tutorial
[2] http://www.postgresql.org/docs/current/interactive/sql-notify.html
[3] http://www.postgresql.org/docs/current/interactive/sql-createrole.html

--
Cédric Villemain               2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support

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



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_restore question
Next
From: Rajinder Yadav
Date:
Subject: pgadmin3 and pgdesigner source