Home » U++ Library support » U++ SQL » PostgreSql does not handle BOOL correctly
Re: PostgreSql does not handle BOOL correctly [BUG+PATCH] [message #60220 is a reply to message #60219] |
Sat, 21 October 2023 00:33   |
omari
Messages: 276 Registered: March 2010
|
Experienced Member |
|
|
Hi Mirek,
the actual solution traite BOOL field like INT, with value 0 for false and 1 for true.
this work well for all dialect, except PGSQL.(I will provide a test case in the following post)
my patch, create a new type that is like INT (0: false, 1: true) for all dialect, but like char(1) for PGSQL ( '0': false, '1': true)
Quote:
switch(dialect) {
case PGSQL:
*r << ( x ? "'1'" : "'0'");
break;
default:
*r << ( x ? "1" : "0");
}
regards
omari.
|
|
|
Goto Forum:
Current Time: Thu Aug 21 18:20:39 CEST 2025
Total time taken to generate the page: 0.05445 seconds
|