Solved

i need help in order to have my jobs working in postgresql.

Posted on 2008-10-20
6
604 Views
Last Modified: 2012-06-27
Hello experts,

i'm running postgresql on windows 2003 server.
i have installed pgAgent,
 
i have created a function in a database,
my function output values in a  table of the same database,
i have tested my function, she does the job as expected, when fire
it from the sql input interface in pgAdmin.

i have created a job that should fire the function,
the problem is that i have no idea why the job doesn't fire the function.
i don't know what 's the erorr,  

this is the output in my pgadmin.log when i "run now" my job.

2008-10-20 12:40:46 QUERY  : Void query (localhost:5432): UPDATE pgagent.pga_job SET jobnextrun = now() WHERE jobid=2
2008-10-20 12:40:46 STATUS : Refreshing pgAgent Job...
2008-10-20 12:40:46 QUERY  : Set query (localhost:5432): SELECT j.*, cl.*, ag.*, sub.jlgstatus AS joblastresult   FROM pgagent.pga_job j JOIN  pgagent.pga_jobclass cl ON cl.jclid=jobjclid LEFT OUTER JOIN  pgagent.pga_jobagent ag ON ag.jagpid=jobagentid LEFT OUTER JOIN  (SELECT DISTINCT ON (jlgjobid) jlgstatus, jlgjobid   FROM pgagent.pga_joblog  ORDER BY jlgjobid, jlgid desc) sub ON sub.jlgjobid = j.jobid
   WHERE j.jobid=2ORDER BY jobname;
2008-10-20 12:40:46 INFO   : Deleting pgAgent Job level_to_mail for refresh
2008-10-20 12:40:46 INFO   : Replacing with new node pgAgent Job level_to_mail for refresh
2008-10-20 12:40:46 INFO   : Displaying properties for pgAgent Job level_to_mail
2008-10-20 12:40:46 INFO   : Adding child objects to Job.
2008-10-20 12:40:46 QUERY  : Set query (localhost:5432): SELECT * FROM pgagent.pga_schedule
 WHERE jscjobid=2
 ORDER BY jscname
2008-10-20 12:40:46 QUERY  : Set query (localhost:5432): SELECT * FROM pgagent.pga_exception
 WHERE jexscid=3

help......help....
0
Comment
Question by:toshi_
  • 4
  • 2
6 Comments
 

Author Comment

by:toshi_
Comment Utility
the step definition in my job is as follow (only a function call)

select level_of_day();
0
 

Author Comment

by:toshi_
Comment Utility
in my database, after installing pgAgent
i have a Catalogs with pgAgent which contains 8 tables,
except the pgagent.pga_jobclass all tables are empty, is it normal?
.....
argh, argh...help
0
 
LVL 10

Accepted Solution

by:
ivanovn earned 500 total points
Comment Utility
Your pgagent tables should have some data (if you created a job after installing the pgagent). You should have data in pga_job, pga_jobstep, etc. So for some reason the job you're creating is not getting inserted into the tables correctly. You may want to check if the pgagent user has correct privileges.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:toshi_
Comment Utility
greate, a step forward

0
 

Author Comment

by:toshi_
Comment Utility
i know now how to check if my job is correctly entered.


0
 
LVL 10

Expert Comment

by:ivanovn
Comment Utility
The other thing you may want to check is whether your pgagent service is running. If the service is not running, the jobs will not be executed.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Best database to use for Maps is PostgreSQL. This is an open source database. Comes as a package with most Linux OS. For more info visit the following site: http://www.postgresql.org/ (http://www.postgresql.org/) This requires some add-o…
Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now