agora inbox for pgsql-admin@postgresql.org
help / color / mirror / Atom feedFrom: shammat@gmx.net
To: pgsql-admin@lists.postgresql.org
Subject: Re: Changing the Datatype from Bit to Boolean.
Date: Tue, 25 Feb 2025 12:55:01 +0100
Message-ID: <88c8494d-92fe-4fbd-bed7-0afd5ef423a1@gmx.net> (raw)
In-Reply-To: <CAHOGQfV58qmC5SR2wj5r4bmP8yzaJtajtNPTeHFFq4c+NZreUw@mail.gmail.com>
References: <CAHOGQfV58qmC5SR2wj5r4bmP8yzaJtajtNPTeHFFq4c+NZreUw@mail.gmail.com>
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');
view thread (6+ messages)
Message-ID: <88c8494d-92fe-4fbd-bed7-0afd5ef423a1@gmx.net>
Permalink: ../88c8494d-92fe-4fbd-bed7-0afd5ef423a1@gmx.net/
Also on: postgresql.org/message-id/88c8494d-92fe-4fbd-bed7-0afd5ef423a1@gmx.net
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: shammat@gmx.net, pgsql-admin@lists.postgresql.org
Subject: Re: Changing the Datatype from Bit to Boolean.
In-Reply-To: <88c8494d-92fe-4fbd-bed7-0afd5ef423a1@gmx.net>
* 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