Re: Is there anyway to...

From: Richard Troy <rtroy(at)ScienceTools(dot)com>
To: AgentM <agentm(at)themactionfaction(dot)com>
Cc: pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is there anyway to...
Date: 2006-11-02 20:00:48
Message-ID: Pine.LNX.4.33.0611021157280.1126-100000@denzel.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general pgsql-sql

On Thu, 2 Nov 2006, AgentM wrote:
> >
> > Just some commentary... This is exactly the sort of thing cron is
> > for. Duplicating that functionality in the RDBMS would be silly
> > IMO. I don't see why you could consider cron to be "dirty" for
> > this application...
>
> I actually tried to come up with something for this. There are plenty
> of good reasons to have some timer functionality in the database:
>
> 1) it makes regular database-oriented tasks OS portable
> 2) your cron user needs specific permissions + authorization to
> access the database whereas postgres could handle "sudo"-like
> behavior transparently
> 3) there are triggers other than time that could be handy- on vacuum,
> on db start, on db quit, on NOTIFY
>
> Unfortunately, the limitation I came across was for 2). There is no
> way to use "set session authorization" or "set role" safely because
> the wrapped code could always exit from the sandbox. So my timer only
> works for db superusers.
>
> -M

...This type of need is exactly what custom written daemons are for.
They're surely database and OS portable (or can be, at least), there's no
need for any super-user capability of any kind, you can use any kind of
trigger you like, and there's no permission leakage problem, either... I
guess all you need is functioning nohup capability (which Windows systems
may have trouble with, I don't know).

Richard

--
Richard Troy, Chief Scientist
Science Tools Corporation
510-924-1363 or 202-747-1263
rtroy(at)ScienceTools(dot)com, http://ScienceTools.com/

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ron Johnson 2006-11-02 20:28:29 Re: Is there anyway to...
Previous Message AgentM 2006-11-02 19:55:50 Re: Is there anyway to...

Browse pgsql-general by date

  From Date Subject
Next Message Dan Weber 2006-11-02 20:22:52 Re: query takes 65 times longer if I add 1 column (explain attached)
Previous Message AgentM 2006-11-02 19:55:50 Re: Is there anyway to...

Browse pgsql-sql by date

  From Date Subject
Next Message Ron Johnson 2006-11-02 20:28:29 Re: Is there anyway to...
Previous Message AgentM 2006-11-02 19:55:50 Re: Is there anyway to...