Re: Bools as char not providing expected result

From: Abhishek Kumar <abhishek(dot)aak0(at)gmail(dot)com>
To: Dave Cramer <davecramer(at)postgres(dot)rocks>
Cc: pgsql-odbc(at)lists(dot)postgresql(dot)org
Subject: Re: Bools as char not providing expected result
Date: 2024-07-30 12:14:34
Message-ID: CAAyULEDbZ92AsVZBokvtpySbK4RomdGyvb5W1ROyArn55iRJfQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi Dave,

I could get the solution to this. The flag is "BoolsAsChar" and not
"bools_as_char". With BoolsAsChar, it works fine.

Regards,
Abhishek Kumar

On Tue, Jul 30, 2024 at 4:12 PM Dave Cramer <davecramer(at)postgres(dot)rocks>
wrote:

> HI Abhishek,
>
> Please file this report at postgresql-interfaces/psqlodbc (github.com)
> <https://github.com/postgresql-interfaces/psqlodbc>
>
> <https://github.com/postgresql-interfaces/psqlodbc>Thanks,
> Dave Cramer
> www.postgres.rocks
>
>
> On Tue, 30 Jul 2024 at 05:56, Abhishek Kumar <abhishek(dot)aak0(at)gmail(dot)com>
> wrote:
>
>> Hi,
>>
>> I am working on an ODBC linux CPP application using the psqlodbc driver.
>>
>> I am passing *"bools_as_char=0;" * when i do a SQLDriverConnect. Below
>> is the full connection string
>>
>>
>> "HostName=localhost;PORT=5432;Database=postgres;UID=postgres;PWD=postgres;bools_as_char=0;DRIVER=PostgreSQLNative;"
>>
>>
>> According to my understanding, bool_as_char is set to 1 by default in
>> psqlodbc code. I am trying to override that to 0 such that i get the
>> boolean treated as a SQL_BIT with precision 1. However, the driver is still
>> returning SQL_VARCHAR and precision as 5(PG_WIDTH_OF_BOOLS_AS_CHAR in the
>> psqlodbc code).
>>
>>
>> Can you please help here?
>>
>>
>> Regards,
>>
>> Abhishek
>>
>

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Jon Raiford 2024-07-30 13:03:46 Windows for ARM support?
Previous Message Dave Cramer 2024-07-30 10:42:21 Re: Bools as char not providing expected result