OS: Ubuntu 18.04.1 and Windows 10
Database: PostgreSQL 10 and 9.5
Lucee version 5.2.8.50
Datasource: PostgreSQL JDBC Driver
Checked: ‘Enable binary large object retrieval (BLOB)’
Lucee is unable to insert BLOB data into the database.
The error is:
ERROR: column “blob” is of type bytea but expression is of type bigint
Hint: You will need to rewrite or cast the expression.
The code is:
<cfif FileExists(file_path)>
<cffile action="readBinary" file="#file_path#" variable="file_blob">
<cftransaction>
<cfquery datasource="blob_test" name="blob_test">
INSERT INTO blob_test (id, blob)
VALUES (1, <cfqueryparam value="#file_blob#" cfsqltype='cf_sql_blob'>)
</cfquery>
</cftransaction>
</cfif>
Lucee seems to recognize BLOB data as BIGINT. Any workaround to solve this?