Re: boolean as 0 and 1

Поиск
Список
Период
Сортировка
От Aarni Ruuhimäki
Тема Re: boolean as 0 and 1
Дата
Msg-id 200804081306.13727.aarni@kymi.com
обсуждение исходный текст
Ответ на boolean as 0 and 1  ("A B" <gentosaker@gmail.com>)
Список pgsql-novice
On Tuesday 08 April 2008 12:54, A B wrote:
> Hi,
> Is there a way to make postgresql to automatically convert integer
> values to boolean?
>
> Consider
>
> create table x (a boolean);
> insert into x (a) values (1);
>
> the inser fails :-(
> Is there a way to make it work without altering the insert command?

Hi,

testing=# ALTER TABLE bar ADD a_boolean boolean;
ALTER TABLE
testing=# INSERT INTO bar (a_boolean) VALUES ('1');
INSERT 9459039 1


--
Aarni Ruuhimäki
---
Burglars usually come in through your windows.
---

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

Предыдущее
От: "Shoaib Mir"
Дата:
Сообщение: Re: boolean as 0 and 1
Следующее
От: "Francois Cote"
Дата:
Сообщение: Re: Problem with data storage