public inbox for pgsql-admin@postgresql.org  
help / color / mirror / Atom feed
From: Gambhir Singh <gambhir.singh05@gmail.com>
To: Pgsql-admin <pgsql-admin@lists.postgresql.org>
To: pgsql-general@lists.postgresql.org
Subject: Alter the datatype on all tables present in the database (bigint to varchar)
Date: Mon, 11 May 2026 18:01:05 +0530
Message-ID: <CAHOGQfVo0FWX8mS9FLTmpDOb5XC5-T4qx4ouhw0wOfNeLdahsA@mail.gmail.com> (raw)

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


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: gambhir.singh05@gmail.com, pgsql-admin@lists.postgresql.org, pgsql-general@lists.postgresql.org
  Subject: Re: Alter the datatype on all tables present in the database (bigint to varchar)
  In-Reply-To: <CAHOGQfVo0FWX8mS9FLTmpDOb5XC5-T4qx4ouhw0wOfNeLdahsA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox