Re: pg_agent jobs

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: pg_agent jobs
Дата
Msg-id fe3c18d9-5392-4a5e-a840-4b340d86f840@aklaver.com
обсуждение исходный текст
Ответ на pg_agent jobs  (Giovanni Biscontini <biscontini.g@es2000.it>)
Ответы Re: pg_agent jobs  (Giovanni Biscontini <biscontini.g@es2000.it>)
Список pgsql-general
On 9/29/23 08:55, Giovanni Biscontini wrote:
> Hello all members, here's my question: db version 14.5
> we have to create a pg_agent job with 2 steps:
> 1_step execute query: if query result is true or find > 0 records then 
> process next step, else it stops executing job
> 2_step execute batch command
> we tried to seta as 1_step the query:
> SELECT EXISTS (SELECT * FROM mytable WHERE someconditions)
> but even if it returns false 2_step is always executed.
> Need some help, thanks in advance, Giovanni

The only thing I could see here:

https://www.pgadmin.org/docs/pgadmin4/development/pgagent_jobs.html

that might work is:

"
Use the On error drop-down to specify the behavior of pgAgent if it 
encounters an error while executing the step. Select from:

     Fail - Stop the job if you encounter an error while processing this 
step.

     Success - Mark the step as completing successfully, and continue.

     Ignore - Ignore the error, and continue.
"

So in the first step induce an error if the conditions are not met.


> -- 
> 
> best regards
> 
> 
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com




В списке pgsql-general по дате отправления:

Предыдущее
От: Giovanni Biscontini
Дата:
Сообщение: pg_agent jobs
Следующее
От: "Wong, Kam Fook (TR Technology)"
Дата:
Сообщение: RE: [EXT] YNT: Need help tuning a query