Re: Question on pg_cron

From: sud <suds1434(at)gmail(dot)com>
To: yudhi s <learnerdatabase99(at)gmail(dot)com>
Cc: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Question on pg_cron
Date: 2024-06-09 06:27:11
Message-ID: CAD=mzVXXjR7Ur4+YaRgd-QeYhtNVqkmHtepj-69VS8SJrUMbvg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Jun 8, 2024 at 10:05 PM yudhi s <learnerdatabase99(at)gmail(dot)com> wrote:

>
>
> On Sat, 8 Jun, 2024, 9:53 pm Ron Johnson, <ronljohnsonjr(at)gmail(dot)com> wrote:
>
>> On Sat, Jun 8, 2024 at 5:31 AM yudhi s <learnerdatabase99(at)gmail(dot)com>
>> wrote:
>>
>>> Hello All,
>>>
>>> We have around 10 different partition tables for which the partition
>>> maintenance is done using pg_partman extension. These tables have foreign
>>> key dependency between them. We just called partman.run_maintanance_proc()
>>> through pg_cron without any parameters and it was working fine. So we can
>>> see only one entry in the cron.job table. And it runs daily once.
>>>
>>> It was all working fine and we were seeing the historical partition
>>> being dropped and new partitions being created without any issue. But
>>> suddenly we started seeing, its getting failed with error "ERROR: can not
>>> drop schema1.tab1_part_p2023_12_01 because other objects depend on it"
>>>
>>
>> Have you changed version lately of PG, pg_cron or pg_partman? Or maybe
>> what pg_cron or pg_partman depends on?
>>
>
> No version change, but we updated the part_config to set premake from 30
> to 60 for all the tables. But not sure how that impacted this behavior.
>
> However, do you think, we should better control the order of execution
> rather letting postgres to decide it's own, considering there is no such
> parameters for this ordering in part_config? And in that case which
> approach should we use out of the two i mentioned. Or any other strategies,
> should we follow, please advise?
>

I believe, You should log this as an issue in the pg_partman open source
project.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lok P 2024-06-09 08:09:56 Re: Creating big indexes
Previous Message Lok P 2024-06-09 05:09:01 Re: Creating big indexes