der-michael opened a new issue, #5912:
URL: https://github.com/apache/hop/issues/5912
### Apache Hop version?
2.15.0
### Java version?
openjdk version "21.0.8" 2025-07-15 LTS
### Operating system
Windows
### What happened?
If a boolean field is recognized by HOP in a Table Input it leads to errors
in the PostgreSQL Bulk Loader. It can easily be reproduced like so:
1. Create a source table
`CREATE TABLE postgresbool_src ( textfield varchar(20) NULL, boolfield bool
NULL);`
2. Insert Data
`INSERT INTO postgresbool_src
(textfield, boolfield) VALUES('test01', false);`
3. Create a target table
`CREATE TABLE postgresbool ( textfield varchar(20) NULL, boolfield bool
NULL);`
If loaded directly from Table Input to PostgreSQL Bulk Loader this error
appears:
> 2025/10/27 11:51:37 - PostgreSQL Bulk Loader.0 - ERROR: Error in transform
> 2025/10/27 11:51:37 - PostgreSQL Bulk Loader.0 - ERROR:
org.postgresql.util.PSQLException: ERROR: invalid input syntax for type
boolean: "1.0"
> Where: COPY postgresbool, line 1, column boolfield: "1.0"
My interpretation here would be that the HOP internal value for bool gets
misinterpreted or transformed to 1.0 instead of 1 which PostgreSQL Loader
cannot read directly as stated in documentation [1].
The error can be mitigated by changing the data type to string (i.e. via
Select Values transform) or using the Table Output object. Both work arounds
have an impact on performance and take more time to set up. The same problem
does not appear if read from CSV Input - I have seen the same behaviour with
Salesforce Input however.
I have opened a stackoverflow thread [2] no one was able to answer and then
found that this bug apparently already existed years ago in Pentaho [3].
[1] https://www.postgresql.org/docs/current/datatype-boolean.html
[2]
https://stackoverflow.com/questions/79798449/apache-hop-postgresql-bulk-loader-boolean-bug
[3]
https://stackoverflow.com/questions/48748360/pentaho-cannot-import-boolean-value-to-table-with-postgresql-bulk-loader?rq=2
### Issue Priority
Priority: 2
### Issue Component
Component: Transforms
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]