Re: Format of BOOLEAN

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Format of BOOLEAN
Дата
Msg-id Pine.LNX.4.30.0106122018570.756-100000@peter.localdomain
обсуждение исходный текст
Ответ на Format of BOOLEAN  ("Lehmeier, Michael" <michael.lehmeier@cognitech.de>)
Список pgsql-general
Lehmeier, Michael writes:

> testdb=# SELECT * FROM testtable WHERE acolumn = t;
> ERROR:  Attribute 't' not found

SELECT * FROM testtable WHERE acolumn = 't';

Or better yet (SQL compatible):

SELECT * FROM testtable WHERE acolumn is true;

The latter is a special syntax, whereas in the former the 't' is just an
ordinary data literal.

> Is it possible to change the settings of PostgreSQL somewhere so that
> I get 'true' or 'false'?

case when acolumn then 'true' else 'false' end

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


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

Предыдущее
От: Doug McNaught
Дата:
Сообщение: Re: linking tables
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: abs() does not exists..