Re: boolean as 0 and 1

From: "Shoaib Mir" <shoaibmir(at)gmail(dot)com>
To: "A B" <gentosaker(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: boolean as 0 and 1
Date: 2008-04-08 09:59:15
Message-ID: bf54be870804080259y58290f8bw614b07250bfc09e9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tue, Apr 8, 2008 at 7:54 PM, A B <gentosaker(at)gmail(dot)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(at)fast(dot)fujitsu(dot)com(dot)au

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Shoaib Mir 2008-04-08 10:03:20 Re: boolean as 0 and 1
Previous Message A B 2008-04-08 09:54:09 boolean as 0 and 1