Search Postgresql Archives

Re: Is there a way to return "true"/"false" string for boolean type?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7 January 2014 19:11, ChoonSoo Park <luispark@xxxxxxxxx> wrote:
Hello Gurus,

I have several tables with lots of boolean columns.
When I run select query for the tables, I always get 't' or 'f' for boolean types.

Is there a way to return 'true' or 'false' string for boolean type except using CASE WHEN ... clause?
I mean global postgres configuration setting to return 'true'/'false' instead of t/f.

Thank you,
Choon Park

Hi,
if you cast the boolean values to text, then you should get 'true'/'false':

SELECT true::boolean::text, false::boolean::text;
 text | text  
------+-------
 true | false
(1 row)

Does it solve your problem? Why do you want to have true/false instead of t/f?

regards,
Szymon

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux