Re: Alter the datatype on all tables present in the database (bigint to varchar)

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Alter the datatype on all tables present in the database (bigint to varchar)
Date: 2026-05-14 17:00:28
Message-ID: 81c8a5b6-c640-465a-9b67-5c692af3fb70@aklaver.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

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(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Ron Johnson 2026-05-14 17:20:12 Re: Alter the datatype on all tables present in the database (bigint to varchar)
Previous Message Raj 2026-05-14 12:19:19 Pgbouncer

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2026-05-14 17:20:12 Re: Alter the datatype on all tables present in the database (bigint to varchar)
Previous Message Peter J. Holzer 2026-05-14 08:46:47 Re: Problem linking with Release library