Re: Format of BOOLEAN - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: Format of BOOLEAN
Date
Msg-id Pine.LNX.4.30.0106122018570.756-100000@peter.localdomain
Whole thread Raw
In response to Format of BOOLEAN  ("Lehmeier, Michael" <michael.lehmeier@cognitech.de>)
List 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 by date:

Previous
From: Doug McNaught
Date:
Subject: Re: linking tables
Next
From: Stephan Szabo
Date:
Subject: Re: abs() does not exists..