lundi 26 janvier 2015

AWS Redshift Posix pattern matching

I'm quering a Redshift cluster using jdbc. The query has a single parameter:



select * from table_name bc where bc.column_name ~ ? limit 10


I'm suppling the parameter using



stmt.setString(1, "expected_value");


The query execution fails with and exception:



org.postgresql.util.PSQLException: ERROR: The pattern must be a valid UTF-8 literal character expression
Detail:
-----------------------------------------------
error: The pattern must be a valid UTF-8 literal character expression
code: 8001
context:
query: 496280
location: cgx_impl.cpp:1902
process: padbmaster [pid=4192]
-----------------------------------------------


Executing a query without a parameter works fine:



select * from table_name bc where bc.column_name 'expected_value' ? limit 10


Any ideas what might cause the exception?





Aucun commentaire:

Enregistrer un commentaire