Re: [pgsql-sql] Daily digest v1.3328 (5 messages)

From: "TJ O'Donnell" <tjo(at)acm(dot)org>
To: rod(at)iol(dot)ie
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [pgsql-sql] Daily digest v1.3328 (5 messages)
Date: 2010-09-24 00:28:23
Message-ID: AANLkTi=HSVXiwJDeyc6vvgceZ4mE32cwW8Vn8u4honBh@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yes indeed, pg_query returns "t" or "f" as strings when selecting
boolean columns.
I was able to switch over to PDO with only an afternoon's work and it works
perfectly for boolean columns, returning values that are properly interpreted
as true and false by php, and by json_encode. I'm all set now.
Thanks for the help!

TJ O'Donnell

On Thu, Sep 23, 2010 at 1:18 AM, Raymond O'Donnell <rod(at)iol(dot)ie> wrote:
> On 23/09/2010 02:00, Adrian Klaver wrote:
>>
>> On Wednesday 22 September 2010 5:40:55 pm David Wilson wrote:
>>>
>>> On Wed, Sep 22, 2010 at 8:30 PM, Adrian
>>> Klaver<adrian(dot)klaver(at)gmail(dot)com>wrote:
>>>>
>>>>  From here;
>>>>
>>>> http://www.postgresql.org/docs/8.4/interactive/datatype-boolean.html
>>>
>>> I believe the question relates to changing the string *output* of the
>>> database to something other than 't' and 'f', not an issue with input
>>> formats.
>>
>> Oops missed that. This would seem to an adapter problem. I work with
>> Python and
>> psycopg2 adapts the boolean values to True and False. Not sure about the
>> PHP
>> solution.
>
> AFAIK the native functions (pg_query() etc) output 't' and 'f', but PDO
> (which I've been using in the context of Zend Framework) output "real" true
> and false values.
>
> Ray.
>
> --
> Raymond O'Donnell :: Galway :: Ireland
> rod(at)iol(dot)ie
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Maciek Sakrejda 2010-09-24 01:24:18 Re: Nested literal parsing rules?
Previous Message Andrew Hunter 2010-09-23 22:37:15 Re: Visualize GiST Index