添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
满身肌肉的鸭蛋  ·  Amazon.co.uk·  14 小时前    · 
个性的红茶  ·  How to Solve the ...·  1 周前    · 
失望的苹果  ·  OS操作系统 - 研华·  2 周前    · 
健身的显示器  ·  Can I connect my ...·  2 周前    · 
文质彬彬的凉面  ·  TS 下uint8array 转 ...·  2 月前    · 
另类的牙膏  ·  Firing Events | ...·  3 月前    · 
爱笑的日记本  ·  java.sql.SQLException: ...·  3 月前    · 

SYMPTOM

When executing a mapping or a query which loads data into a Postgresql database, the following error may occur if source data contains a NUL character (we are talking about the 0x00 value, not the "null" which means no-value)

org.postgresql.util.PSQLException: ERROR: invalid byte sequence for encoding "UTF8": 0x00
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:405)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2893)
at com.indy.engine.actionCodes.JdbcActionCodeI.a(SourceFile:516)
at com.indy.engine.actionCodes.JdbcActionCodeI.finalizeDirectBindedFetch(SourceFile:541)
at com.indy.engine.action.common.ActionCodeTypeI.a(SourceFile:1111)
at com.indy.engine.action.common.ActionCodeTypeI.executeDirectBindedCode(SourceFile:1322)
at com.indy.engine.action.common.ActionCodeTypeI.executeBindedCode(SourceFile:1448)
at com.indy.engine.action.common.ActionCodeTypeI.executeCode(SourceFile:1505)
at com.indy.engine.action.common.ActionCodeTypeI.run(SourceFile:1666)
at java.lang.Thread.run(Thread.java:748)

SOLUTION

Postgresql cannot load the NUL character. You need to process the source data in order to remove NUL characters.

For example, you can add a Stage between the source and the Postgresql target, and apply a REPLACE() function to the target field.

Example with an H2 stage:

REPLACE(source.column, char(0), '')

We use cookies to try and give you a better experience in Freshdesk.

You can learn more about what kind of cookies we use, why, and how from our Privacy Policy . If you hate cookies, or are just on a diet, you can disable them altogether too. Just note that the Freshdesk service is pretty big on some cookies (we love the choco-chip ones), and some portions of Freshdesk may not work properly if you disable cookies.

We’ll also assume you agree to the way we use cookies and are ok with it as described in our Privacy Policy , unless you choose to disable them altogether through your browser.