Re: Changing the Datatype from Bit to Boolean.

From: shammat(at)gmx(dot)net
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Changing the Datatype from Bit to Boolean.
Date: 2025-02-25 11:55:01
Message-ID: 88c8494d-92fe-4fbd-bed7-0afd5ef423a1@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Gambhir Singh schrieb am 23.02.2025 um 06:56:
> Aurora PostgreSQL DB has a table in which one column has the
> datatype BIT(1). Now the requirement is that I have to change the
> datatype of that column from BIT to BOOLEAN. There are only a few
> rows in the table.
If you store 1 as true and 0 as false, you can use something like this:

alter table the_table
alter the_column type boolean using (the_column = '1');

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Mauricio Fernandez 2025-02-25 12:45:10 Re: Installing version other than the last one
Previous Message Ron Johnson 2025-02-25 05:18:26 Re: V12 to V16 Upgrade -- does size matters?