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

From: Joe Van Dyk <joe(at)tanga(dot)com>
To: ChoonSoo Park <luispark(at)gmail(dot)com>
Cc: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is there a way to return "true"/"false" string for boolean type?
Date: 2014-01-07 22:37:42
Message-ID: CACfv+pLa8AoyTsC2qKMd_zv56SgW0MSrztJFOBjJ8vqeym6Zdw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jan 7, 2014 at 10:11 AM, ChoonSoo Park <luispark(at)gmail(dot)com> 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.
>

Question for others..

hstore(record) doesn't seem to cast the rows to text using the normal text
cast, right? Why is that?

If I have a table with a boolean column and I call hstore(table), I see
't', not 'true'.

But true::text is 'true' and false::text is 'false'.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2014-01-07 23:37:15 Re: How to know server status variable in postgresql?
Previous Message Sergey Konoplev 2014-01-07 22:22:54 Re: Sudden slow down and spike in system CPU causes max_connections to get exhausted