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.96) (envelope-from ) id 1wNXUl-000sxc-2S for pgsql-admin@arkaria.postgresql.org; Thu, 14 May 2026 14:57:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wNX43-00D4jC-37 for pgsql-admin@arkaria.postgresql.org; Thu, 14 May 2026 14:29:27 +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.96) (envelope-from ) id 1wMPnW-000n04-2V for pgsql-admin@lists.postgresql.org; Mon, 11 May 2026 12:31:46 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wMPnU-000000002nK-2g0M for pgsql-admin@lists.postgresql.org; Mon, 11 May 2026 12:31:46 +0000 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-67c9616b4feso6284007a12.1 for ; Mon, 11 May 2026 05:31:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1778502703; cv=none; d=google.com; s=arc-20240605; b=DqhhalQmwClzbw9GxkhZKIpVAp0cffZ4m6xO1P0BImOzBP9CDmFEiBSgu4kZOn2W3V 5bda9UhbS4hCe43NY2sf4v5dckqbv06uw/bPrxaJgYupZcAr+GA7ld1n5lf3uTKe8XUQ sfZ9nsVAYhm7mY+2ArlE04NeGylv6UBtVhn2BHDZVi4Xp9DGi/VlE2YyOnpvTM0AKZLs /w6rJ5AhSBlfk6YmHSWe1lFkZisiUgGJ7bT/pgs+OAujHjrCuuQL11rMsS7Ckt+S5nyt BN+5RI4bnGJDM/ko5QZrWshvH40mF/GRg8hzdNEFI8TuLm7uaadn3HXCYKhamlNJ9ih3 VzGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=b6WO6wSdRuM1FrqL06IFjGMFlbiA+V06sOy/dHklPOc=; fh=RaKg3Zgp456LfiSdeQA1Y3TTVoT7gzPvABbI2l8nV9I=; b=bf1X1CXaFGUxYztwXsJAkA18XLjUuIpEiLavubO+tmacygJihWT1llED+ULZ6noTZR lBY/H2RNL9p5zhhBxEN656fYAJjXLRUlcs9pXjdT7SQ+501/fC/55K7HQMGiX222q13n 4u+AHDujoHrf1Kv8TvukwSA6i3gt5B9h+aXQSKSKRMFcKMRKqYyB2vrsr+V2GB4RSwX+ kYfEUaGT88p+w1nesHV8+tmxStZCa+J/j86A3VV87kmeg8jzxlQkBevTkVRu+/S0cFpT PxrVeXoJsFl/EESGv9Fv9vkUbalmQHjg8Hs9S+LXUu29wJ1aT+eTVI9alAti1x/VKdBZ XT/A==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778502703; x=1779107503; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=b6WO6wSdRuM1FrqL06IFjGMFlbiA+V06sOy/dHklPOc=; b=EZEgzJ5yJGPS98wI1lDc/RekxVdGi8e1dnSOSRD7nOZoa0QaoqsS3588PEzpz9GxA1 SunELC5XGAuVksuzQ2NICpp2tEzRIh7oiguHfRzowWb3Hpl+/VC0k+WI1ErNwmqcFHku fbN207QX7JzivFyvR3lLVyFSUC42BrpWM61qIrTATCyldGgCiGTZUcPM6pYoheCyiEzs 8PFzOytA7oqecSpxTiPOpe4/sxnyfRSLST+/pStTfCfu+kncq6HCV6jGqtAAfWw9Uw4j 6sr4fBS6O3GtU0r7T6QizfdAmNY2/pxNCAk6sGP6TbUMc+f3ER/GtZKx91CV3INakg3K /dTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778502703; x=1779107503; h=to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=b6WO6wSdRuM1FrqL06IFjGMFlbiA+V06sOy/dHklPOc=; b=j6w0+kUqchk9a1L6OV9QyDVEDPn2f1K9VhYw0ludOKKlcU/s/Oi30LoqVaVw9v9z5B 0GCsHYTyH9zAXhqijZ++dYwV5oj9k2rZ0CZqjb2wJ19+FfA/KsJDC/L2aV0pLGF2iqBG Xkn6X79I95dBkZBX9kMNLpYurt5E0TGqwLl/TOsW5FiW0zIZmjnCwiHFrQqIceSty5kT ztR1RtVNnBcG/WZALNZf5vb8xLdQdBgEq/TQTbm4afr3H+pVBSjyhKm6CoKUtGS9AVJ4 Ld6BjFzcwtCQtzukxsbjJc4U4N5UQFn+ihGVX9FvokwYVIjhLWNbpC6o0WmrU8mUD1Br O6hg== X-Gm-Message-State: AOJu0YxJTxe/F12Yu5nT6KvO744NH7JAiarvYssoZ8DRVADSnBO+DgrR i8/3SFjUeK0qvGJNt0NERSLxdAMo6o7JT6XjU/n1iHJKaOVzAl56eS6a9n0Yo7p/1QONgkyCXKf dD3ntFavyvZKzHbPRnF2daAxSfTD7IbBqflZmk80= X-Gm-Gg: Acq92OGrV3tvqIg3Nmesj+eF0wkAuItbE0YVaZU52BpCta/UJJBsV89UbJnq+zM4rU2 9tT50srjYQUu6NQecGwN9Fkx/E4PbQ5sgikV2HTZyQgtiFsWOFsCH3T3KbbLHuBLvCTSEnDtU05 gFsKhvLcZbvhtcB/f7HHXQqYzRh9m5xhrJEcHydY2Y+U50cNvxA1oEuxRUp1Z4WgMZxm+kbezCq EcjhVzaDYgu8YOwp/KscHCNxVtJM3x5zAxD/YAeN1QufyIgqpyJSTvjIS4aHrlH2yBzdk3SwA7w Ahn9ohWFjIi9UWY8TmM/zSlm76uxjUnapJRoxwoTtDqML9bRfhwghaf/liO5UpFidIV/ZeHw X-Received: by 2002:a05:6402:5044:b0:665:3d68:c46c with SMTP id 4fb4d7f45d1cf-67f710c2d57mr3488448a12.14.1778502703122; Mon, 11 May 2026 05:31:43 -0700 (PDT) MIME-Version: 1.0 From: Gambhir Singh Date: Mon, 11 May 2026 18:01:05 +0530 X-Gm-Features: AVHnY4LOCGTSMq4y1UhbXhoDnThVj-IDO58TmAdPJd9uZ3a-A395pHFCeSN1tvQ Message-ID: Subject: Alter the datatype on all tables present in the database (bigint to varchar) To: Pgsql-admin , pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000da0f69065189ed13" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000da0f69065189ed13 Content-Type: text/plain; charset="UTF-8" Hi, Please help me with the best way to change the datatype of a column in a all tables in DB from bigint to varchar. Please consider the following facts. - DB Size - 75 TB - Number of tables - ~100 - Some tables are partitioned and some are not partitioned. - All partitioned tables are big in size. - For reference, the largest partition size is 4 TB, similarly the size of 10-12 partitions ranges between 1 to 4 TB. - We have indexes and FK on tables. - Physical Replication is configured with 2 standby DBs. -- Thanks & Regards Gambhir Singh --000000000000da0f69065189ed13 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

Please help me with the best= way to change the datatype of a column in a all tables in DB from bigint t= o varchar. Please consider the following facts.

  • DB = Size - 75 TB
  • Number of tables - ~100
  • Some tables are partit= ioned and some are not partitioned.
  • All partitioned tables are big = in size.
  • For reference, the largest partition size is 4 TB, similar= ly the size of 10-12 partitions ranges between 1 to 4 TB.
  • We have i= ndexes and FK on tables.=C2=A0
  • Physical Replication is configured w= ith 2 standby DBs.=C2=A0=C2=A0

--
Thanks & Reg= ards
Gambhir Singh

--000000000000da0f69065189ed13--