Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYkw8-00DofN-Rn for pgsql-in-general@arkaria.postgresql.org; Tue, 30 Jul 2024 11:22:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sYkw7-008jfw-F1 for pgsql-in-general@arkaria.postgresql.org; Tue, 30 Jul 2024 11:22:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYkw7-008jUB-4l for pgsql-in-general@lists.postgresql.org; Tue, 30 Jul 2024 11:22:35 +0000 Received: from mail-yw1-x1136.google.com ([2607:f8b0:4864:20::1136]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sYkw3-002CQQ-CK for pgsql-in-general@postgresql.org; Tue, 30 Jul 2024 11:22:33 +0000 Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-65cd720cee2so29372317b3.1 for ; Tue, 30 Jul 2024 04:22:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722338551; x=1722943351; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=aE/YhJwbmCNjXXAQRtE8aWMJhVJaBgKIDnCyCX++Md4=; b=C8JJskDLkbi3RRbMTSt+3sDjvOfKnbeQuiq57UPcCXT72SjWG0Vm7DM7LcYqa0c6RR jlf/LGkNccszWBQXk/dZJ2GKbbgU8LXLy3Dqm9BALcfL5OJzDrp/dT3f57U6od6fJWy0 XgveSpjkX2XpZRQ2ssVKy/TXEN6PajgtLZgeS8g3bJhFBUE2zKXioJgOqvllYDPHi2mO x1mHbxKy7oMT1v/913rMXvViHb6JaDj7qsDNlJzgQtsoj4o+54oZrBM3gTRPq1Tqlf6X /N7PQw1WGyJvWKugs3/6PD8y7Aldn5HrBOm6tSSnsnG/wQSAvSl/MczA3XkdoqKcdrqN nOWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722338551; x=1722943351; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aE/YhJwbmCNjXXAQRtE8aWMJhVJaBgKIDnCyCX++Md4=; b=LH8YSWIfJLVZsgjbHSCabqERoHvDAFPv3ubMTkI/FUwQ+NIewj19vO/omUSF/nyaBS YSFotAgRW4U1PnaDlYPVs3hN2YBrx9TmJxk9p/oUJeE7cXEXi9YMhKpyJoFhvUXJ6VO+ LzYN/EJbRjFJ/xuFmFRTUCCAMGoJlrer0cIeb2uzS9GGU2Lw6BJW9gfAka/1G3EPtoeR NhkgbkqfixUPVCkWEppb3OJrzPgkDWxuDyuQdCdWf3vcoIiz4bRYu03c8sfDPFbN7vtX svMP/KmGb36KngwB8ht8xhl1GQLJF4DBHlX8pg/EyxS0hA2aoSCRzBkhtiol/qEGj6xe SNvw== X-Forwarded-Encrypted: i=1; AJvYcCVq9rT0j0JqIm/hAl1Xnd8+uO/aExtkp2vxnrbez5bkYDEX/Q+10YEBMKRp3RyFAeTv2Zy6U5LK9hldhQ9b9YzbIjiuaYWv6EhdIPnK/u4v X-Gm-Message-State: AOJu0YyHy5OnE0QGeur5YuwCIm0VFyrh5Q/QYtzbDXW4PoQEsmuMHXkl 1HBjl5g+dkJw0iwj9EONFmEwwppxQLgm+agQJxG1BLwH6A/lqh8UlcOEUaoeRFCWZrkVo/K6mrO 2rQjqne4Nd1+6lb+WjIXO+I5Bek0= X-Google-Smtp-Source: AGHT+IEDoKgh1m5CPYOc80OhcLqEV0tTuejVU0m670i+QY4IhFjunSMyCAlhbwmHt0QeU6NkI3ttAnDzjEPeO5grcEo= X-Received: by 2002:a05:690c:4803:b0:664:a85d:47c6 with SMTP id 00721157ae682-67a09f4acf5mr116422547b3.33.1722338550662; Tue, 30 Jul 2024 04:22:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Muhammad Imtiaz Date: Tue, 30 Jul 2024 16:22:17 +0500 Message-ID: Subject: Re: Scheduling pg_repack job with pg_cron To: Durgamahesh Manne Cc: pgsql-general@lists.postgresql.org, pgsql-in-general@postgresql.org Content-Type: multipart/alternative; boundary="0000000000007ecd40061e7531b5" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000007ecd40061e7531b5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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.m@bitnine.net * On Tue, Jul 30, 2024 at 1:58=E2=80=AFPM Durgamahesh Manne 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 > --0000000000007ecd40061e7531b5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi ,=C2=A0
Yes, you can use it= . Create a bash script containing the pg_repack command logic, then call th= is bash script from a PL/pgSQL function. Finally, schedule this PL/pgSQL fu= nction using pg_cron as follows.
SELECT cron.schedule('pg_repack_job= ', '00 3 * * 1-5', $$SELECT repackfunc();$$);

Muhammad = Imtiaz

PostgreSQ= L Technical Support Lead=C2=A0/ Pakistan R&D

<= b>Mobile: +923345072521<= /font>


On Tue, Jul 30, 2024 at 1:58=E2=80= =AFPM Durgamahesh Manne <ma= heshpostgres9@gmail.com> wrote:
Hi
Respected Team
Is there any way to schedule a pg_repack job with pg_cron withi= n the instance ?

If yes then please please let me = know the best approach to schedule=C2=A0it with pg_cron within=C2=A0the ins= tance.( not in bastion host)=C2=A0

your response i= s=C2=A0highly valuable

Regards.
Durga Ma= hesh
--0000000000007ecd40061e7531b5--