Обсуждение: how to be related with the schedule and step
I use pgAgent 3.4 in pgAdmin 4 to create a job. In this job I create a schedule and a step.
I query the table pga_job, pga_jobagent, I find pga_job.jobagentid is null.
That means it is not related with this schedule and step.
How to operate that it will be related with the pga_job.jobagentid and pga_jobagent.jagpid,
this is the error logs:
========================================================================================================================
2018-09-12 11:00:06 HKT [7300]: [1-1] user=postgres,db=postgres,app=jpgAgent: WIN-IL4VKOA9EAB,client=127.0.0.1 ERROR: insert or update on table "pga_job" violates foreign key constraint "pga_job_jobagentid_fkey"
2018-09-12 11:00:06 HKT [7300]: [2-1] user=postgres,db=postgres,app=jpgAgent: WIN-IL4VKOA9EAB,client=127.0.0.1 DETAIL: Key (jobagentid)=(7300) is not present in table "pga_jobagent".
2018-09-12 11:00:06 HKT [7300]: [3-1] user=postgres,db=postgres,app=jpgAgent: WIN-IL4VKOA9EAB,client=127.0.0.1 STATEMENT: UPDATE pgagent.pga_job SET jobagentid=$1, joblastrun=now() WHERE jobenabled AND jobagentid IS NULL AND jobnextrun <= now() AND (jobhostagent = '' OR jobhostagent = $2) RETURNING jobid, jobname, jobdesc
============================================================================================================================
On Wed, Sep 12, 2018 at 7:43 AM, jimmy <mpokky@126.com> wrote:
I use pgAgent 3.4 in pgAdmin 4 to create a job. In this job I create a schedule and a step.I query the table pga_job, pga_jobagent, I find pga_job.jobagentid is null.That means it is not related with this schedule and step.How to operate that it will be related with the pga_job.jobagentid and pga_jobagent.jagpid,
Those fields are used for internal tracking, and should not be modified.
What are you trying to do exactly?
this is the error logs:============================================================ ============================== ============================== 2018-09-12 11:00:06 HKT [7300]: [1-1] user=postgres,db=postgres,app=jpgAgent: WIN-IL4VKOA9EAB,client=127.0. 0.1 ERROR: insert or update on table "pga_job" violates foreign key constraint "pga_job_jobagentid_fkey" 2018-09-12 11:00:06 HKT [7300]: [2-1] user=postgres,db=postgres,app=jpgAgent: WIN-IL4VKOA9EAB,client=127.0. 0.1 DETAIL: Key (jobagentid)=(7300) is not present in table "pga_jobagent". 2018-09-12 11:00:06 HKT [7300]: [3-1] user=postgres,db=postgres,app=jpgAgent: WIN-IL4VKOA9EAB,client=127.0. 0.1 STATEMENT: UPDATE pgagent.pga_job SET jobagentid=$1, joblastrun=now() WHERE jobenabled AND jobagentid IS NULL AND jobnextrun <= now() AND (jobhostagent = '' OR jobhostagent = $2) RETURNING jobid, jobname, jobdesc ============================================================ ============================== ============================== ====
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
When I checked postgresql's log, I found these error messages.Before that I didn't do anything.
After finding these errors, I have no idear where it is wrong.
I use postgresql for windows, so I use the jpgAgent.
When I found these errors, I set jobagentid of pgagent.pga_job to 7300.
After that I found the time of executing job is not updated in the property of pgagent job.
I am confused.
BTW:when I restart the postgresql for windows , does jpgAgent need to be restarted?
在 2018-09-12 16:22:24,"Dave Page" <dpage@pgadmin.org> 写道:
On Wed, Sep 12, 2018 at 7:43 AM, jimmy <mpokky@126.com> wrote:I use pgAgent 3.4 in pgAdmin 4 to create a job. In this job I create a schedule and a step.I query the table pga_job, pga_jobagent, I find pga_job.jobagentid is null.That means it is not related with this schedule and step.How to operate that it will be related with the pga_job.jobagentid and pga_jobagent.jagpid,Those fields are used for internal tracking, and should not be modified.What are you trying to do exactly?this is the error logs:============================================================ ============================== ============================== 2018-09-12 11:00:06 HKT [7300]: [1-1] user=postgres,db=postgres,app=jpgAgent: WIN-IL4VKOA9EAB,client=127.0. 0.1 ERROR: insert or update on table "pga_job" violates foreign key constraint "pga_job_jobagentid_fkey" 2018-09-12 11:00:06 HKT [7300]: [2-1] user=postgres,db=postgres,app=jpgAgent: WIN-IL4VKOA9EAB,client=127.0. 0.1 DETAIL: Key (jobagentid)=(7300) is not present in table "pga_jobagent". 2018-09-12 11:00:06 HKT [7300]: [3-1] user=postgres,db=postgres,app=jpgAgent: WIN-IL4VKOA9EAB,client=127.0. 0.1 STATEMENT: UPDATE pgagent.pga_job SET jobagentid=$1, joblastrun=now() WHERE jobenabled AND jobagentid IS NULL AND jobnextrun <= now() AND (jobhostagent = '' OR jobhostagent = $2) RETURNING jobid, jobname, jobdesc ============================================================ ============================== ============================== ====
--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
On Tue, Sep 18, 2018 at 1:59 AM, jimmy <mpokky@126.com> wrote:
When I checked postgresql's log, I found these error messages.Before that I didn't do anything.After finding these errors, I have no idear where it is wrong.I use postgresql for windows, so I use the jpgAgent.When I found these errors, I set jobagentid of pgagent.pga_job to 7300.After that I found the time of executing job is not updated in the property of pgagent job.I am confused.BTW:when I restart the postgresql for windows , does jpgAgent need to be restarted?
jpgAgent is not supported by us, or pgAdmin. I know it claims to be compatible, but I have no idea if it actually is.
We maintain pgAgent, which you can use on pretty much any platform.
在 2018-09-12 16:22:24,"Dave Page" <dpage@pgadmin.org> 写道:On Wed, Sep 12, 2018 at 7:43 AM, jimmy <mpokky@126.com> wrote:I use pgAgent 3.4 in pgAdmin 4 to create a job. In this job I create a schedule and a step.I query the table pga_job, pga_jobagent, I find pga_job.jobagentid is null.That means it is not related with this schedule and step.How to operate that it will be related with the pga_job.jobagentid and pga_jobagent.jagpid,Those fields are used for internal tracking, and should not be modified.What are you trying to do exactly?this is the error logs:============================================================ ============================== ============================== 2018-09-12 11:00:06 HKT [7300]: [1-1] user=postgres,db=postgres,app=jpgAgent: WIN-IL4VKOA9EAB,client=127.0.0 .1 ERROR: insert or update on table "pga_job" violates foreign key constraint "pga_job_jobagentid_fkey" 2018-09-12 11:00:06 HKT [7300]: [2-1] user=postgres,db=postgres,app=jpgAgent: WIN-IL4VKOA9EAB,client=127.0.0 .1 DETAIL: Key (jobagentid)=(7300) is not present in table "pga_jobagent". 2018-09-12 11:00:06 HKT [7300]: [3-1] user=postgres,db=postgres,app=jpgAgent: WIN-IL4VKOA9EAB,client=127.0.0 .1 STATEMENT: UPDATE pgagent.pga_job SET jobagentid=$1, joblastrun=now() WHERE jobenabled AND jobagentid IS NULL AND jobnextrun <= now() AND (jobhostagent = '' OR jobhostagent = $2) RETURNING jobid, jobname, jobdesc ============================================================ ============================== ============================== ====
--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company