Re: Format of BOOLEAN
| От | Doug McNaught |
|---|---|
| Тема | Re: Format of BOOLEAN |
| Дата | |
| Msg-id | m31yopshtz.fsf@belphigor.mcnaught.org обсуждение |
| Ответ на | Format of BOOLEAN ("Lehmeier, Michael" <michael.lehmeier@cognitech.de>) |
| Список | pgsql-general |
"Lehmeier, Michael" <michael.lehmeier@cognitech.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
В списке pgsql-general по дате отправления: