Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
omari is currently offline  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.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SqlPerformScript bug: Not doing anything if script starts with "BEGIN;" and ends with "END;"
Next Topic: Sqlite3 update
Goto Forum:
  


Current Time: Thu Aug 21 18:20:39 CEST 2025

Total time taken to generate the page: 0.05445 seconds