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 1sctIi-00BChh-W9 for pgsql-general@arkaria.postgresql.org; Sat, 10 Aug 2024 21:07:00 +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 1sctIh-00AUmZ-In for pgsql-general@arkaria.postgresql.org; Sat, 10 Aug 2024 21:06:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sctIh-00AUmM-6w for pgsql-general@lists.postgresql.org; Sat, 10 Aug 2024 21:06:59 +0000 Received: from mail-yw1-x112e.google.com ([2607:f8b0:4864:20::112e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sctIf-004BO5-8v for pgsql-general@lists.postgresql.org; Sat, 10 Aug 2024 21:06:58 +0000 Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-67831d522a5so5941717b3.1 for ; Sat, 10 Aug 2024 14:06:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723324015; x=1723928815; 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=x5PK4PC93biwkIzfFXbZ1lO1eheGuSsx2zExNFORmBY=; b=jgzrxZdCZrFzkKV3grV+dpmx0ZXRdnw+L2TfroBDOiPlGZmhwuiZAqzlRxFJrhVJIk 4+9iyDs//7c1Hg8ojKL1DTI9HM/C0y2bX9TZgHj3q54zJPLtgpYoj4zIV0XaCh8njYR1 BIWvDx4m6zU2C6zNFSJyhcm49w6jxa7JIfxz3AQclNBk+LCRsUBEXHz+E9WONYvsRhg9 tJafpsYTvWPXjdLKLV+JC26cRppesNqw/N8lLCUv9KWbiQoRd7L1whik7LSTRenBt6hV 809FElgSqbUvYAGPyKNtr2oVG9rl/qhRrgBqZTbT2k6KVaKwlSoyhh7A60JPgiTdeSJR i4Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723324015; x=1723928815; 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=x5PK4PC93biwkIzfFXbZ1lO1eheGuSsx2zExNFORmBY=; b=XGwF7b8BUmKHcvk0B6Nt81QlW+Lj8UV2HY/y47+ktuqknJluz/wdDRnE/dXwfuS7Kr SVhzs8smsviF7uaox8h823Mp34fV5uk5d5dsGMcNxaftdYKmKnM6gg6oLY6AcqR74o7Q jT4GHR/qGXrnU0nrBk26jW4U4Oj/omlR7GzkiLemOrW9IRXYz2+BVdZ4jCj+UU60iK51 xVL2sBxt4zZ0IUemehtKBH3A+mgEGpSNT84fPz5Kttv9lyRQ09zkMyo14uPqFsdJ2HF9 8hgT3osUku5LPe/H+g7kGKZwS4BtfZMJMgMWuNzjFioPPuT80HphSGxCpNkxvLolyw26 WlPA== X-Gm-Message-State: AOJu0YzJ6XyPz9/oH0Gvuh4EwHKZbsdiWzX9mLwpqyUfb74xbH2hWmmw xn7eQwWo/RIwbWD47dtpURjcRl0i26xkumgWolHCJKkmsUzSP+IXXyJ9niyZiZxI3ihY4U8jt5q i1Xa/Fti0beQ0W6/Exwbqp45TTqk= X-Google-Smtp-Source: AGHT+IG6NsRN9bLMzaCdcwuXaczRM42a22Xr35fOBC3POOlII7nVEbtacddJ/zC3wC7S/wm6FLs7iKmaGz2UbQfyckE= X-Received: by 2002:a05:690c:398:b0:678:3188:49d3 with SMTP id 00721157ae682-69ebef9d774mr35183897b3.0.1723324014873; Sat, 10 Aug 2024 14:06:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Lok P Date: Sun, 11 Aug 2024 02:36:42 +0530 Message-ID: Subject: Re: Column type modification in big tables To: sud , Greg Sabino Mullane Cc: pgsql-general Content-Type: multipart/alternative; boundary="000000000000bd5a56061f5aa3de" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000bd5a56061f5aa3de Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Aug 10, 2024 at 5:47=E2=80=AFPM sud wrote: > > > My 2cents. > If you have enough time then from a simplicity point of view, your single > line alter command may look good, but how are you going to see the amoun= t > of progress it has made so far and how much time it's going to take to > finish. And you got ~6hrs of down time but if it fails at 5th hour then y= ou > will be in a bad position. > > > Does it mean that , if we get enough downtime then , we should rather go with the option of recreating the table from scratch and populating the data from the existing table and then rename it back? It does look more complicated considering many steps like creating indexes, constraints back and renaming it and then running vacuum and analyze etc. Can someone through some light , in case we get 5-6hrs downtime for this change , then what method should we choose for this Alter operation? --000000000000bd5a56061f5aa3de Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Sat, Aug 10, 2024 at 5:47=E2=80=AFPM s= ud <suds1434@gmail.com> wro= te:


My 2cents.=C2=A0
If you have= enough time then from a simplicity point of view, your single line alter c= ommand may look good, but how are you going to see=C2=A0 the amount of prog= ress it has made so far and how much time it's going to take to finish.= And you got ~6hrs of down time but if it fails at 5th hour then you will b= e in a bad position.=C2=A0


<= /blockquote>
=C2=A0
Does it mean that , if we get enough=C2= =A0downtime then , we should rather go with the option of recreating the ta= ble from scratch and populating the data from the existing table and then r= ename it back? It does look more complicated considering many steps like cr= eating indexes, constraints back and renaming it and then running vacuum an= d analyze etc.=C2=A0

Can someone through=C2=A0some= light , in case we get 5-6hrs downtime for this change , then what method= =C2=A0should=C2=A0we choose for this Alter operation?
--000000000000bd5a56061f5aa3de--