Re: Format of BOOLEAN

From: Doug McNaught <doug(at)wireboard(dot)com>
To: "Lehmeier, Michael" <michael(dot)lehmeier(at)cognitech(dot)de>
Cc: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Format of BOOLEAN
Date: 2001-06-12 17:56:08
Message-ID: m31yopshtz.fsf@belphigor.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Lehmeier, Michael" <michael(dot)lehmeier(at)cognitech(dot)de> writes:

> Hello
>
> When I SELECT a row with a BOOLEAN in it I get either 't' or 'f'.
> But when I use this same value in the WHERE condition I get an error,
> because PostgreSQL demands either 'true' or 'false'.

If you quote the value you get back from Postgres (which you probably
should be doing anyway) it will work:

foo=# create table test1 (f1 boolean);
CREATE
foo=# insert into test1 values ('t');
INSERT 31078 1
foo=# select * from test1;
f1
----
t
(1 row)

foo=# select * from test1 where f1='t';
f1
----
t
(1 row)

-Doug
--
The rain man gave me two cures; he said jump right in,
The first was Texas medicine--the second was just railroad gin,
And like a fool I mixed them, and it strangled up my mind,
Now people just get uglier, and I got no sense of time... --Dylan

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thalis A. Kalfigopoulos 2001-06-12 17:59:10 Re: Format of BOOLEAN
Previous Message Thalis A. Kalfigopoulos 2001-06-12 17:55:02 Oracle news article