jOOQ/jOOQ — pull request #1889 by hencjo (2012-10-26 14:54:18+00:00)
Title: Fix for insert into Postgres String Array when strings contained " or \.

Having quotes (") in a string in a Postgres Array caused the following exception. And backslashes in such string were stripped. -- Fixed.

Exception in thread "main" org.jooq.exception.DataAccessException: SQL [insert into "" () values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?::varchar[], ?, ?)]; ERROR: malformed array literal: "{"""this will not work"}"
at org.jooq.impl.Util.translate(Util.java:621)
at org.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:360)
at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:176)
at org.jooq.impl.InsertImpl.execute(InsertImpl.java:95)

Caused by: org.postgresql.util.PSQLException: ERROR: malformed array literal: "{"""this will not work"}"
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:381)
at org.jooq.impl.DataSourcePreparedStatement.execute(DataSourcePreparedStatement.java:86)
at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:219)
at org.jooq.impl.InsertQueryImpl.execute(InsertQueryImpl.java:487)
at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:172)
... 2 more