Re: Changing the Datatype from Bit to Boolean.

Поиск
Список
Период
Сортировка
От shammat@gmx.net
Тема Re: Changing the Datatype from Bit to Boolean.
Дата
Msg-id 88c8494d-92fe-4fbd-bed7-0afd5ef423a1@gmx.net
обсуждение исходный текст
Ответ на Changing the Datatype from Bit to Boolean.  (Gambhir Singh <gambhir.singh05@gmail.com>)
Список 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');




В списке pgsql-admin по дате отправления: