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 1sGC1f-00AFsA-R3 for pgsql-general@arkaria.postgresql.org; Sun, 09 Jun 2024 06:27: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 1sGC1c-0031x9-As for pgsql-general@arkaria.postgresql.org; Sun, 09 Jun 2024 06:27:33 +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 1sGC1b-0031x1-Rx for pgsql-general@lists.postgresql.org; Sun, 09 Jun 2024 06:27:32 +0000 Received: from mail-ua1-x92c.google.com ([2607:f8b0:4864:20::92c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sGC1W-000Qg4-7t for pgsql-general@lists.postgresql.org; Sun, 09 Jun 2024 06:27:31 +0000 Received: by mail-ua1-x92c.google.com with SMTP id a1e0cc1a2514c-80b87c529e3so137918241.3 for ; Sat, 08 Jun 2024 23:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717914445; x=1718519245; darn=lists.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=GIjykrRcHD+z+U8crib0OR12bT4WiEfaFcpGbesVo+o=; b=SNy0Pn5ZoNq7yhpWFDntKMf261l1d75C/8P4BF9tpzHkfy5kD6wu2QaxnixnPi2UF+ A9lyyFrGe4a/WyVJ+ETvyBeAceQFEIZh/3nu0+KwFFq9bCV/Rv/V+2yM58epP3kyTq0M CjkXild609PEoYU99pkxRCyjfhgXt2WNyiYz6A7mW4Id7H0NMOH8FHH0Kf3rhrNCeY4X ut4YZczPTEux6qk/zuQ9dhj4vFHb4oFImscD+ez7J9M8+vjleu/TkO4P3k/5Ppdb6O15 T3UISZzoTIGxEZOS9taokBA/LW8W6wxB19XR48tP6sURWTCM18IvTaf3ez+ZKfOaEOpm KIvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717914445; x=1718519245; 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=GIjykrRcHD+z+U8crib0OR12bT4WiEfaFcpGbesVo+o=; b=GHuRpR7Jr3ebEvgwP3qme+w5PHSJwwDob+choJPzwKfHN2ZnxjpaZVQyUXCNX1xKAl fny3UISRNF76lD3kDuuLOJ635WYIerYQWEi1PAJmTZTTVTYoeCMUZ3sokoCZtI7K6GX1 1ASqWuIaCyaRRKJA/jl6Ch4UtwwrVuIMhP9+3yt1qT35XM0E8I8zVWH+Z9Bw+cjv0SRe u8RbOTBYwAqlelUO+FszEgWpQ2ONOvD4kYcoA5DnvO2kLQ8JJdMXn46VxsIK6QQA5pa7 +33P9+dk7e1Tnt2dubsqEtrgXaz1J5uCWUiJE2Gwd7ilmIB1TLKvH16jGaix58Y6ceTW fC1A== X-Forwarded-Encrypted: i=1; AJvYcCV+2Qe7zpHX+8a5rbNFxbxDmmtqxbTQg8618Dd3QlkUduVDRSu3pU7K/6h2waJoIPJKXFtc2NM4pjn6WuguWCcnA15nrbhGfyUkvlW+kZwIgxrD X-Gm-Message-State: AOJu0Yzhucilge3jHegp0IgpEso4f3h6+GChRRrv0EoPsABYare06rbM ugkaQt7zeBGFZcftCoHhrS8N+dVlGEIXcAYoyGbxi4mjcRZnX3y7WtzlLMO1Ye1aTyER/D7suDJ 6W6WzZ5orMYCHyFUMTDS2Wp4PJcQ= X-Google-Smtp-Source: AGHT+IFCcaMAV4xLOPDzPLItr/QiExN+KNCGHphAmy3RLZurpzCSVkc4DpeNU/rxZ/UxXglXzV/QUfXtI2y/I17s8so= X-Received: by 2002:a67:f314:0:b0:48c:3cf5:87a7 with SMTP id ada2fe7eead31-48c3cf58aa3mr1881957137.24.1717914444892; Sat, 08 Jun 2024 23:27:24 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: sud Date: Sun, 9 Jun 2024 11:57:11 +0530 Message-ID: Subject: Re: Question on pg_cron To: yudhi s Cc: Ron Johnson , pgsql-general Content-Type: multipart/alternative; boundary="0000000000003e123b061a6f2076" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000003e123b061a6f2076 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Jun 8, 2024 at 10:05=E2=80=AFPM yudhi s wrote: > > > On Sat, 8 Jun, 2024, 9:53 pm Ron Johnson, wrote= : > >> On Sat, Jun 8, 2024 at 5:31=E2=80=AFAM yudhi s >> wrote: >> >>> Hello All, >>> >>> We have around 10 different partition tables for which the partition >>> maintenance is done using pg_partman extension. These tables have forei= gn >>> key dependency between them. We just called partman.run_maintanance_pr= oc() >>> through pg_cron without any parameters and it was working fine. So we c= an >>> 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 n= ot >>> 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 strategie= s, > should we follow, please advise? > I believe, You should log this as an issue in the pg_partman open source project. --0000000000003e123b061a6f2076 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Jun 8, 2024 at 10:05=E2=80=AFPM y= udhi s <learnerdatabase99= @gmail.com> wrote:


On Sat, 8 Jun, 20= 24, 9:53 pm Ron Johnson, <ronljohnsonjr@gmail.com> wrote:
On = Sat, Jun 8, 2024 at 5:31=E2=80=AFAM yudhi s <learnerdatabase99@= gmail.com> wrote:
Hello All,

We = have around 10 different partition tables for which the partition maintenan= ce is done using pg_partman extension. These tables have foreign key depend= ency between them.=C2=A0 We just called partman.run_maintanance_proc() thro= ugh pg_cron without any parameters and it was working fine. So we can see o= nly 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.ta= b1_part_p2023_12_01 because other objects depend on it"
=C2=A0
Have you changed version lately of PG, = pg_cron or pg_partman?=C2=A0 Or maybe what pg_cron or pg_partman depends on= ?

No version change, but we updated the part_config to set pre= make from 30 to 60 for all the tables. But not sure how that impacted this = behavior.=C2=A0

However,= do you think, we should better control the order of execution rather letti= ng 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 w= e use out of the two i mentioned. Or any other strategies, should we follow= , please advise?=C2=A0

=C2=A0I = believe, You should log this as an issue in the pg_partman open source=C2= =A0 project.
--0000000000003e123b061a6f2076--