Skip site navigation (1) Skip section navigation (2)

pgagent using one connection to each job

From: Tomasz Olszak <tolszak(at)o2(dot)pl>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: pgagent using one connection to each job
Date: 2009-03-25 11:07:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgadmin-hackers
I don't know if it is good mailing list but I really need help from people with more experience.
I've tried to use pgagent as job scheduler but I found two significant(for me) problems.
First: You can't execute job every for example 30 seconds, is there a way to do this? I know that one minute is often but if job will execute at 18:00 and will last for 2 seconds the next job will be executed at 18:02  it's 1:58 seconds later, for me it's rather big problem.
I'm working on online transmissions of data between postgres and Oracle. Checking if there is modified data should be every 30-20 seconds, postgres is database for big marketplaces and all data from all postgres is in one central Oracle database.
I've written lot of functions in plperlu using DBD::Oracle module to connect and get data from Oracle. All work well and really fast because of prepared_cached queries and saving connection to ora in plperlu session variable.
But when I tried to execute functions in pgagent steps they weren't work so fast.
pgagent is creating new session for each executed job and clearing session pl/perlu variables where connection to Oracle and cached queries are stored.
So my questions are:
1.  Is there a way that you can execute job more often that one minute?
2.  Can pgagent use the same session to the same job?
3.  Is it very difficult to add seconds to schedule?
I'm grateful of any of your help, if I don't  solve this problem i will have to write application to run this functions, but I really want to use pgagent.
Tomasz Olszak


pgadmin-hackers by date

Next:From: Dave PageDate: 2009-03-25 11:40:40
Subject: Re: pgagent using one connection to each job
Previous:From: svnDate: 2009-03-24 11:47:01
Subject: SVN Commit by dpage: r7753 - trunk/pgadmin3/pgadmin/ui

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group