Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id BC89DB5DBD0 for ; Mon, 3 Oct 2011 07:12:51 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 58257-01 for ; Mon, 3 Oct 2011 10:12:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from cpanelsmarthost1.zen.co.uk (cpanelsmarthost1.zen.co.uk [82.71.204.225]) by mail.postgresql.org (Postfix) with ESMTP id 1F656B5DBD2 for ; Mon, 3 Oct 2011 07:12:45 -0300 (ADT) Received: from [88.98.24.71] (helo=shcp03.hosting.zen.net.uk) by cpanelsmarthost1.zen.co.uk with esmtp (Exim 4.72) (envelope-from ) id 1RAfVs-0003EH-9f for pgsql-jdbc@postgresql.org; Mon, 03 Oct 2011 10:12:44 +0000 Received: from [212.135.39.5] (helo=[62.185.32.161]) by shcp03.hosting.zen.net.uk with esmtpa (Exim 4.69) (envelope-from ) id 1RAfVp-0004lr-2r for pgsql-jdbc@postgresql.org; Mon, 03 Oct 2011 11:12:41 +0100 Message-ID: <4E898B0C.5@ahastie.net> Date: Mon, 03 Oct 2011 11:14:36 +0100 From: Andrew Hastie User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: OpenJPA problems running against PG 8.1 Content-Type: multipart/alternative; boundary="------------060003020901060509040904" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - shcp03.hosting.zen.net.uk X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - ahastie.net X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.777 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, URI_HEX=1.122 X-Spam-Level: X-Archive-Number: 201110/12 X-Sequence-Number: 22265 This is a multi-part message in MIME format. --------------060003020901060509040904 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Posting here for info only as I don't believe this is a "bug" as such, rather a change in behaviour:- Latest 2.1.1 stable version of Apache OpenJPA project appears broken when running against Postgres when upgraded to v9.1. This I think is down to the changes in escape string handling in SQL LIKE clauses. Here's a link to the bug I've lodged against OpenJPA which includes details of how to configure an override at runtime to the default Postgres DBDictionary setting which will get things working again:- http://openjpa.208410.n2.nabble.com/Postgres-V9-1-issue-with-LIKE-clause-and-Escape-Strings-td6848069.html Also copying here for info just in case:- ======================================================= Noticed an issue with the Postgres DBDictionary definition after updating Postgres from version 8.4 to 9.1:- Here's what you get in the Postgres trace file when executing some JPA driven queries where an SQL LIKE is involved:- 2011-09-30 14:29:41 BST ERROR: invalid escape string 2011-09-30 14:29:41 BST HINT: Escape string must be empty or one character. 2011-09-30 14:29:41 BST STATEMENT: SELECT t0.id, t0.identificationMask, t0.productName FROM DBTYPE t0 WHERE (t0.identificationMask LIKE $1 ESCAPE '\\') 2011-09-30 14:29:41 BST ERROR: current transaction is aborted, commands ignored until end of transaction block This appears to be down to a change the Postgres project have made to escape string handling:- http://www.postgresql.org/docs/9.1/static/release-9-1.html (see section E.2.2.1) You appear to be able to override the default DBDictionary setting for this as follows to get things working again:- So, does this mean OpenJPA needs a version dependent dictionary definition for Postgres from now on? Anybody got any better solutions or care to confirm what I'm seeing? I've also posted this to the Postgres JDBC mailing list in case they have any comments. ======================================================= Andrew -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc --------------060003020901060509040904 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Posting here for info only as I don't believe this is a "bug" as such, rather a change in behaviour:-

Latest 2.1.1 stable version of Apache OpenJPA project appears broken when running against Postgres when upgraded to v9.1. This I think is down to the changes in escape string handling in SQL LIKE clauses. Here's a link to the bug I've lodged against OpenJPA which includes details of how to configure an override at runtime to the default Postgres DBDictionary setting which will get things working again:-

  http://openjpa.208410.n2.nabble.com/Postgres-V9-1-issue-with-LIKE-clause-and-Escape-Strings-td6848069.html

Also copying here for info just in case:-

=======================================================
Noticed an issue with the Postgres DBDictionary definition after
updating Postgres from version 8.4 to 9.1:-

Here's what you get in the Postgres trace file when executing some JPA
driven queries where an SQL LIKE is involved:-

2011-09-30 14:29:41 BST ERROR:  invalid escape string
2011-09-30 14:29:41 BST HINT:  Escape string must be empty or one character.
2011-09-30 14:29:41 BST STATEMENT:  SELECT t0.id, t0.identificationMask,
t0.productName FROM DBTYPE t0 WHERE (t0.identificationMask LIKE $1
ESCAPE '\\')
2011-09-30 14:29:41 BST ERROR:  current transaction is aborted, commands
ignored until end of transaction block

This appears to be down to a change the Postgres project have made to
escape string handling:-
http://www.postgresql.org/docs/9.1/static/release-9-1.html (see
section E.2.2.1)

You appear to be able to override the default DBDictionary setting for
this as follows to get things working again:-
<property name="openjpa.jdbc.DBDictionary"
value="postgres(SearchStringEscape=\)"/>

So, does this mean OpenJPA needs a version dependent dictionary
definition for Postgres from now on? Anybody got any better solutions or
care to confirm what I'm seeing?

I've also posted this to the Postgres JDBC mailing list in case they
have any comments.
=======================================================

Andrew

-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

--------------060003020901060509040904--