Re: Scheduling pg_repack job with pg_cron

From: Muhammad Imtiaz <imtiazpg712(at)gmail(dot)com>
To: Durgamahesh Manne <maheshpostgres9(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org, pgsql-in-general(at)postgresql(dot)org
Subject: Re: Scheduling pg_repack job with pg_cron
Date: 2024-07-30 11:22:17
Message-ID: CACW1Ly1PxOp_i30VLKBNLOius_ahXRx6RRoLVsHE5Rm1w+BUog@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-in-general

Hi ,

Yes, you can use it. Create a bash script containing the pg_repack
command logic, then call this bash script from a PL/pgSQL function.
Finally, schedule this PL/pgSQL function using pg_cron as follows.
SELECT cron.schedule('pg_repack_job', '00 3 * * 1-5', $$SELECT repackfunc();$$);

*Muhammad Imtiaz*

*PostgreSQL Technical Support Lead *
*/ Pakistan R&D*
*Mobile: +923345072521*
*Email: imtiaz(dot)m(at)bitnine(dot)net <imtiaz(dot)m(at)bitnine(dot)net>*

On Tue, Jul 30, 2024 at 1:58 PM Durgamahesh Manne <maheshpostgres9(at)gmail(dot)com>
wrote:

> Hi
> Respected Team
>
> Is there any way to schedule a pg_repack job with pg_cron within the
> instance ?
>
> If yes then please please let me know the best approach to schedule it
> with pg_cron within the instance.( not in bastion host)
>
> your response is highly valuable
>
> Regards.
> Durga Mahesh
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Koen De Groote 2024-07-30 13:47:18 Understanding conflicts on publications and subscriptions
Previous Message Durgamahesh Manne 2024-07-30 08:59:36 Scheduling pg_repack job with pg_cron

Browse pgsql-in-general by date

  From Date Subject
Previous Message Durgamahesh Manne 2024-07-30 08:59:36 Scheduling pg_repack job with pg_cron