Thread: How can I stop a long run pgAgent job?

How can I stop a long run pgAgent job?

From
"a"
Date:
Hi 

I'm using pgAdmin 4, pgAgent and postgresql 10 on windows server.

I tried a job but due to some reasons, its running long time. Is there a way that I can terminate it ??

Thanks

Shore

Re: How can I stop a long run pgAgent job?

From
Fabio Pardi
Date:

Hi Shore,

Have a look at:

https://www.postgresql.org/docs/current/static/functions-admin.html

'pg_terminate_backend' is probably what you are looking for

regards,

fabio pardi

On 21/06/18 11:32, a wrote:
Hi 

I'm using pgAdmin 4, pgAgent and postgresql 10 on windows server.

I tried a job but due to some reasons, its running long time. Is there a way that I can terminate it ??

Thanks

Shore

Re: How can I stop a long run pgAgent job?

From
Adam Brusselback
Date:
As said, terminating a backend is the current way to kill a job.

An alternative if this is something you do often: https://github.com/GoSimpleLLC/jpgAgent
jpgAgent supports terminating a job by issuing a NOTIFY command on the correct channel like this: NOTIFY jpgagent_kill_job, 'job_id_here';
It works well with windows, and all the existing pgAgent admin tools work to manage it, it's just a drop in replacement for the agent portion.