Re: Is there anyway to...

From: AgentM <agentm(at)themactionfaction(dot)com>
To: pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is there anyway to...
Date: 2006-11-02 19:37:22
Message-ID: 26B58EAC-4BCC-470E-AC5E-477A5AA4CA52@themactionfaction.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general pgsql-sql


On Nov 2, 2006, at 14:02 , Glen Parker wrote:

> louis gonzales wrote:
>> Hey Brian,
>> Yeah I had considered this, using cron, I just feel like that is
>> too dirty.
>> Actually I didn't see Andreas' post, can someone forward that?
>> I'm running this application on Solaris 9. Ultimately what I want
>> to know is, is there something that is internal to postgresql that
>> can be used that doesn't need external action, to make it do some
>> task?
>> Some built in function that can be set to do some simple task on a
>> daily - or other time - interval, where all of the defined users
>> may not have any activity with the database for day's or week's at
>> a time, but this builtin function still operates?
>> Am I making any sense with how I'm asking this? I could of course
>> have cron do a scheduled task of checking/incrementing/
>> decrementing and define triggers to occur when one of the cron
>> delivered actions sets the appropriate trigger off, but are there
>> other methods that are standard in the industry or are we stuck
>> with this type of external influence?
>
>
> 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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message louis gonzales 2006-11-02 19:46:18 Re: Is there anyway to...
Previous Message imad 2006-11-02 19:32:21 Re: [GENERAL] Is there anyway to...

Browse pgsql-general by date

  From Date Subject
Next Message louis gonzales 2006-11-02 19:46:18 Re: Is there anyway to...
Previous Message Tony Caduto 2006-11-02 19:32:25 Does anyone have a compiled dblink_tds for Redhat EL 4.x?

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Hanson 2006-11-02 19:43:31 Determining correct table order for insert or drop statements to satisfy foreign keys
Previous Message imad 2006-11-02 19:32:21 Re: [GENERAL] Is there anyway to...