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 1wNZQJ-000uZK-08 for pgsql-general@arkaria.postgresql.org; Thu, 14 May 2026 17:00:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wNZQH-00E3Sc-2O for pgsql-general@arkaria.postgresql.org; Thu, 14 May 2026 17:00: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.96) (envelope-from ) id 1wNZQH-00E3SJ-0r for pgsql-general@lists.postgresql.org; Thu, 14 May 2026 17:00:33 +0000 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wNZQF-00000000ZVU-1oyi for pgsql-general@lists.postgresql.org; Thu, 14 May 2026 17:00:32 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 45AAC7A00A1 for ; Thu, 14 May 2026 13:00:30 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Thu, 14 May 2026 13:00:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1778778030; x=1778864430; bh=mhW44DwIWyNUySIBXFbKwJEaJknuu1d6BddrQqtATOg=; b= D/CVLO/olzoYyRKZuuMZKzKcAw5ngyBuFB9FAHwm7TdYNsV6PxKJ0gDP7fZufk9m fRVZegY0sF5rGZ08PCYKZfIrM0YSZ07nzIinlGnogB474bs+JG/qNZyMCIBMWVX7 vCkd/0pMWphAPUzJutjTDbyyfnCJJqzJeEzUEsXAO4cusWV9swvUzga4ixZvW5FO BHVBBaipNwC4/eQUOhjWArx3CzYts3FtqzDeegU72qRWa2S2t35IxjjKXtCitDQN wIUOoD1COFGLZVubkQ7/GrTTJM/KST0T5tMY+VF42whXUJkais28NZvI3D+d13+v s1FT6f7kieqvdJNjKRzqxg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1778778030; x=1778864430; bh=m hW44DwIWyNUySIBXFbKwJEaJknuu1d6BddrQqtATOg=; b=FhHE5Tq5o2dPRUqX/ B7Ez/6snkjwMqxW59c1GntNL1ofYElkwOz1ZaIsnURoMuKoYNyaDHsn0pHYzrJyB bYVfBSmvveJ6TvMgk0iqLN3371BGBEALTEsc59ifH5/5fQjcVmIaEuI16kXKvBla jOplhnqkmnDEf8skGRnLuRcgdR5CcrqmYB84oKR1UGtWC8qlxZRvh+maNChXeSK8 r6N9aKXvUzt/F3KTmi2swhXE4T6zF/kWxxdk8gawF76+NVs8LQLEKpWHLzpVj5HB m54Cr6mL3QJqShBZTq6AxC31Uz6gG1hkipIGp2blLyBJukrlO7deSaz69YNHtt5m EKzUQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdduvdektdeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertd dtvdejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgr vhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepiedvhfeiheehge euieeljeeitedtjeehudegfeelkedvleekhedtgfeiffefkedunecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrh esrghklhgrvhgvrhdrtghomhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlheslhhishhtshdrphhoshhtgh hrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 14 May 2026 13:00:29 -0400 (EDT) Message-ID: <81c8a5b6-c640-465a-9b67-5c692af3fb70@aklaver.com> Date: Thu, 14 May 2026 10:00:28 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Alter the datatype on all tables present in the database (bigint to varchar) To: pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 5/11/26 5:31 AM, Gambhir Singh wrote: > 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. 1) Do not cross post to multiple lists. 2) What is the purpose behind this change? > > * 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 > -- Adrian Klaver adrian.klaver@aklaver.com