Re: 0/1 vs true/false

From: Franco Bruno Borghesi <franco(at)akyasociados(dot)com(dot)ar>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jochem van Dieten <jochemd(at)oli(dot)tudelft(dot)nl>, Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>, pgsql-general(at)postgresql(dot)org
Subject: Re: 0/1 vs true/false
Date: 2003-07-23 20:01:23
Message-ID: 1058990482.765.5.camel@taz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

and what about boolean attirbutes in where clauses? Is any difference
between

-SELECT ... WHERE boolean_field
and
-SELECT ... WHERE boolean_field=true
?

On Wed, 2003-07-23 at 11:48, Tom Lane wrote:

> Franco Bruno Borghesi <franco(at)akyasociados(dot)com(dot)ar> writes:
> > This makes me wonder, what about 't' and 'f'?... will they disappear in
> > newer versions of postgreSQL?
>
> No. See my comment about I/O representations being outside the spec.
> There is no inconsistency in the following examples:
>
> regression=# select true;
> bool
> ------
> t
> (1 row)
>
> regression=# select t;
> ERROR: attribute "t" not found
> regression=# select 't'::boolean;
> bool
> ------
> t
> (1 row)
>
> regression=# select '1'::boolean;
> bool
> ------
> t
> (1 row)
>
>
> regards, tom lane
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sell 2003-07-23 20:28:28 Re: Join Problem
Previous Message scott.marlowe 2003-07-23 19:55:12 Re: Join Problem