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 1sXd5b-005FMi-Av for pgsql-general@arkaria.postgresql.org; Sat, 27 Jul 2024 08:47:43 +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 1sXd5Z-003jxB-Jz for pgsql-general@arkaria.postgresql.org; Sat, 27 Jul 2024 08:47:41 +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 1sXd5Z-003juX-84 for pgsql-general@lists.postgresql.org; Sat, 27 Jul 2024 08:47:41 +0000 Received: from mail-yb1-xb33.google.com ([2607:f8b0:4864:20::b33]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sXd5W-001grX-KM for pgsql-general@lists.postgresql.org; Sat, 27 Jul 2024 08:47:40 +0000 Received: by mail-yb1-xb33.google.com with SMTP id 3f1490d57ef6-e05eb1c7bd4so79009276.1 for ; Sat, 27 Jul 2024 01:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722070057; x=1722674857; 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=DMbBosbnJyeoPRW76rpoC/vX4Y3MmF6r1Gr9X0mvsPs=; b=BEAo58zsYSCqGkWoLRqa26cLXBlfDPWfqsGFGOpzTv9rzFbQ5/w24T3z+qDBsnDlmY ejdlenLsJYpyCjlHE6vAPLVslvY917R6vFSFg6UZeV3GybgKV8eCCOs0Xaxv+GfxOyXm TrpBSnnHT6AzYJmFsvP1+9uhCTtjuKlq7HhsENJitA5ip/+/iYTYzt3VipDpE1W2dN8a XNUqLbx5hqoGCbAwPAEkFwsJAF+Wyx9mN5BptB8CV9RbJbjLv9pD1C2Dob2/D4IvYCCp xWmAORPQRuKrbFdAl35iZeiv5gS4Z7qPLCW/4KRsSxDxt8hMUzatoPVg1Kl3ZD3UF6Oh n4gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722070057; x=1722674857; 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=DMbBosbnJyeoPRW76rpoC/vX4Y3MmF6r1Gr9X0mvsPs=; b=gROUY7LpbqGSqrcMcJJEbnKeWz1Y8xL43KLbSm/Ljwr8govBCmuJSSnXe32UuOvVxz 9MGv+xolGuBJLyTSjbZdaKD5Jy4nqQuZaX44NrKRp+mty0sYMkvaGyaXbTWQ/DXY+60l PBSPNC+cVPTv2GTLxcyTM7TZSxA19uAf5gcC/7I65ZQ8z6cm1L6HOdL+d/vNXFD9QQ9h WrkbiHAqgiydcvOiTtpGUBHOf9bhrOH6KeLXK9Xo4OmlFp0TgCFx8eRUegbw/5C+yVMG b5hrwkx3NO8sI+Yt0u5fcr/MaALfppt3ZAXFqrR3LAA7pQmwsoBe+alq70OdlY/8tuJa EzrQ== X-Gm-Message-State: AOJu0Ywi4ezUrCCNJX0VuBRwHHgk7ffAGRux+zUsSTKF4YSt9UQJUN0j JFGLYjnw8VuJ9AD80m2ELFlTEFXWQlFGt4zhhj+D6T2whZZLA3G5cwWvjNcRTiWiTA/MQyyAzQP 3ZSQZbxf85MasaXDLZ6WTmRk/tEs= X-Google-Smtp-Source: AGHT+IGFv/7JiavxCmKsKissxuQmwZabaXUzUjDHDR2GmnuiHmN1XxZvZWVsPhXjWkabHGfh5dcZsKeY0laMh6uwM8A= X-Received: by 2002:a05:6902:983:b0:e0b:5c75:d7ec with SMTP id 3f1490d57ef6-e0b5c75db58mr394840276.3.1722070057590; Sat, 27 Jul 2024 01:47:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Lok P Date: Sat, 27 Jul 2024 14:17:26 +0530 Message-ID: Subject: Re: Partition boundary messed up To: yudhi s Cc: pgsql-general Content-Type: multipart/alternative; boundary="0000000000000fa9e3061e36ae97" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000000fa9e3061e36ae97 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you. I understand that is going to take a lot of time as we already have billions of rows in the main table spread across 40+ partitions. Also this table is child to another parent partition table and so, it will take a lot of time to validate the FK constraint back for the new table. Is there a less disruptive way(zero to minimal downtime) possible to fix this mess? On Sat, Jul 27, 2024 at 2:08=E2=80=AFPM yudhi s wrote: > If you were thinking of some ALTER command which will just alter the > boundaries of the incorrect partition and make it correct , I don't thin= k > there exists any such. You may have to create a whole new table and run t= he > partman.create_parent block with the UTC time zone set so that all the > subsequent partitions will be created with correct boundaries and then mo= ve > the data into it from the existing table. > > > --0000000000000fa9e3061e36ae97 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you. I understand that is going to = take a lot of time as we already=C2=A0have billions of=C2=A0rows in the mai= n table spread across 40+ partitions.=C2=A0
Also this= table is child to another parent partition table and so,=C2=A0 it will tak= e a lot of time to validate the FK constraint back for the new table.
=
Is there a less disruptive way(zero to minimal downtime)= =C2=A0possible=C2=A0to fix this mess?

On Sat, Jul 27, 2024 at 2:08=E2=80= =AFPM yudhi s <learnerdat= abase99@gmail.com> wrote:
If you were thinking of some ALTER c= ommand which will just alter the boundaries=C2=A0of the incorrect=C2=A0part= ition and make it correct=C2=A0,=C2=A0 I don't think there exists any s= uch. You may have to create a whole new table and run the partman.create_pa= rent block with the UTC time zone=C2=A0set so that all the subsequent parti= tions will be created with correct=C2=A0boundaries and then move the data i= nto it from the existing=C2=A0table.

=C2=A0
--0000000000000fa9e3061e36ae97--