Re: boolean as 0 and 1

Поиск
Список
Период
Сортировка
От Shoaib Mir
Тема Re: boolean as 0 and 1
Дата
Msg-id bf54be870804080259y58290f8bw614b07250bfc09e9@mail.gmail.com
обсуждение исходный текст
Ответ на boolean as 0 and 1  ("A B" <gentosaker@gmail.com>)
Список pgsql-novice


On Tue, Apr 8, 2008 at 7:54 PM, A B <gentosaker@gmail.com> 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?

 
 
Creating a custom cast might help you there....
 
--
Shoaib Mir
Fujitsu Australia Software Technology
shoaibm@fast.fujitsu.com.au

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

Предыдущее
От: "A B"
Дата:
Сообщение: boolean as 0 and 1
Следующее
От: "Shoaib Mir"
Дата:
Сообщение: Re: boolean as 0 and 1