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 1sc8IW-004DEF-2n for pgsql-general@arkaria.postgresql.org; Thu, 08 Aug 2024 18:55:39 +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 1sc8IU-00GDCk-2q for pgsql-general@arkaria.postgresql.org; Thu, 08 Aug 2024 18:55:38 +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 1sc8IT-00GDCc-N8 for pgsql-general@lists.postgresql.org; Thu, 08 Aug 2024 18:55:37 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sc8IR-003ksy-22 for pgsql-general@lists.postgresql.org; Thu, 08 Aug 2024 18:55:36 +0000 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5a108354819so1715151a12.0 for ; Thu, 08 Aug 2024 11:55:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723143333; x=1723748133; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ILcEqXLlpzcZmmTK2rb21DoRaScnrV1TYqhNe7yMiTk=; b=HG244fxMAYevBmmDBvxVK7egvWAuZXK/1hHyuMeQCwChgyU/S4NIs7r1umYCjz7pT3 Op1FzKTn47vNy6tkXek0KBfenrhAONcCNEAcyrqgk7lfq/Yli2kpakWI4QI+pFKOOknr HGnOhI/XPiFR7W9bcs3sSSOSieJlumMocHiB2gSDrFlZUB2nFuAdilQb8roBzmfz51Sb 5JudaOvylHAkJ1MZlWttM0iSvPPsthkm1pv9c3qw2oGsTUGdimZxhrH6adv5qVcRsOo0 1y7rgwijgka5a6M38IdjYEVNGWlQl8DaG/Ouf/jZpujse2AoIp+cr/5fQv4oXkUpxODG sX7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723143333; x=1723748133; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ILcEqXLlpzcZmmTK2rb21DoRaScnrV1TYqhNe7yMiTk=; b=GULUIYZRtf/skWy07Q3BFLgM8xhmTb9zJ8Nmow1GKOs4ryPwexis9AH7Y/XCvsdo4H IYpalNCUPjfQ6RoDhj210Ri8cmVcSuB8svLb3NHtehXas9LnUV0aFSxuS6kX+v2CTFq3 xKz6lYA1HqO3cYowA4OzfeisFkb8JNF+ZFhxQmX7ygSrK1xqWiIyhmFpa3m2bwPNbNGV B+esRJsUyEbDw9i6tbNC95BLqJIP2rEruOYH4dT1fIBtWT5A0hDy2ukDXdh8KnHSXZ/3 3qSwv5dQbATn/iA0fpPaHen5kU0fDmA2h+4URLfGDYM7RgrKypSgAp2dv1S6G+lgt88+ yZoA== X-Forwarded-Encrypted: i=1; AJvYcCVxuon4RfAUAAzdVN8/AJVbAxsLvSWp4M5SNipDpGmY/0uuxxIK4F3ifVZ8Pa/h/mLiE+WbhuVrlB+hN4M+S6tzVezLXCJKDRMn6WLco+wPD5ON X-Gm-Message-State: AOJu0YzNuU2MxwfbdDR2kAi01w9K24uNCzCTqqJ21bMVcfOZMQvzhOJO 2Y+v5ghE7ZQR2bn6ge2LUGV49vkkLOkpLQNsc55VQk0gnsbTw8/S X-Google-Smtp-Source: AGHT+IFw0xHG8pzT7y8uUy7MJCjVtMNZtHXa0p4+C/tkh7HL18kYeegDxb5L4dr7cT6HZtw3fEV/iA== X-Received: by 2002:a05:6402:234c:b0:5a1:7362:91d9 with SMTP id 4fb4d7f45d1cf-5bbb233eefcmr2609745a12.22.1723143332915; Thu, 08 Aug 2024 11:55:32 -0700 (PDT) Received: from smtpclient.apple ([188.212.112.125]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bbb2c3ec77sm878064a12.36.2024.08.08.11.55.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Aug 2024 11:55:32 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: Column type modification in big tables From: Alban Hertroys In-Reply-To: Date: Thu, 8 Aug 2024 20:55:22 +0200 Cc: sud , pgsql-general Content-Transfer-Encoding: quoted-printable Message-Id: <7D2FBDFB-40DD-4458-B213-03EB7311EC4D@gmail.com> References: To: Lok P X-Mailer: Apple Mail (2.3776.700.51) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 8 Aug 2024, at 20:38, Lok P wrote: >=20 > Thank you so much.=20 >=20 > Can anybody suggest any other possible way here. As, we also need to = have the existing values be updated to the new column value here using = update command (even if it will update one partition at a time). And as = I see we have almost all the values in the column not null, which means = it will update almost ~5billion rows across all the partitions. So my = question is , is there any parameter(like work_mem,maintenance_work_mem = etc) which we can set to make this update faster? > or any other way to get this column altered apart from this method? Just a wild thought here that I=E2=80=99m currently not able to check=E2=80= =A6 Can you add views as partitions? They would be read-only of course, = but that would allow you to cast the columns in your original partitions = to the new format, while you can add any new partitions in the new = format. I suspect it=E2=80=99s not allowed, but perhaps worth a try. Alban Hertroys -- There is always an exception to always.