Re: Dropping column from big table

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: sud <suds1434(at)gmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>, "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>
Subject: Re: Dropping column from big table
Date: 2024-07-16 05:42:14
Message-ID: CAKFQuwYu3TMd6Fum51JOTHDXUt_V3BHobz2VnVkpe9QLnjYYgA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday, July 15, 2024, sud <suds1434(at)gmail(dot)com> wrote:

>
> Thank you for the confirmation.
> And if someone wants to fully remove that column from the table , then the
> only option is to create a new table with an exact set of active columns
> and insert the data into that from the existing/old table and then rename
> it back to old. Is this correct understanding?
>

You haven’t removed the column from the table, you’ve removed the whole
dang table while creating a new, wholly unrelated, one that just happens to
have the same name. But the name of a table isn’t its primary key, though
some places do use it for lookup purposes.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shenavai, Manuel 2024-07-16 11:37:15 RE: Monitoring DB size
Previous Message Christophe Pettus 2024-07-16 05:38:46 Re: PostgreSQL Active-Active Clustering