AWS Redshift Posix模式匹配

时间:2015-01-26 11:50:20

标签: java postgresql jdbc amazon-web-services amazon-redshift

我正在使用jdbc查询Redshift集群。该查询只有一个参数:

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

我正在使用

提供参数
stmt.setString(1, "expected_value");

查询执行失败,并带有异常:

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]
  -----------------------------------------------

执行不带参数的查询可以正常工作:

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

任何可能导致异常的想法?

1 个答案:

答案 0 :(得分:0)