pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
OpenJPA problems running against PG 8.1
6+ messages / 3 participants
[nested] [flat]

* OpenJPA problems running against PG 8.1
@ 2011-10-03 09:31  Andrew Hastie <andrew@ahastie.net>
  0 siblings, 2 replies; 6+ messages in thread

From: Andrew Hastie @ 2011-10-03 09:31 UTC (permalink / raw)
  To: pgsql-jdbc

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-td684806...

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* OpenJPA problems running against PG 8.1
@ 2011-10-03 10:14  Andrew Hastie <andrew@ahastie.net>
  0 siblings, 1 reply; 6+ messages in thread

From: Andrew Hastie @ 2011-10-03 10:14 UTC (permalink / raw)
  To: pgsql-jdbc

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-td684806... 


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

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: OpenJPA problems running against PG 8.1
@ 2011-10-03 10:17  Andrew Hastie <andrew@ahastie.net>
  parent: Andrew Hastie <andrew@ahastie.net>
  1 sibling, 0 replies; 6+ messages in thread

From: Andrew Hastie @ 2011-10-03 10:17 UTC (permalink / raw)
  To: pgsql-jdbc

Apologies - posted under wrong thread. Will re-post. (Monday morning 
syndrome :-/ )
Andrew

On 03/10/11 10:31, Andrew Hastie wrote:
> 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-td684806...
>
> 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
>



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: OpenJPA problems running against PG 8.1
@ 2011-10-03 10:27  Oliver Jowett <oliver@opencloud.com>
  parent: Andrew Hastie <andrew@ahastie.net>
  1 sibling, 0 replies; 6+ messages in thread

From: Oliver Jowett @ 2011-10-03 10:27 UTC (permalink / raw)
  To: Andrew Hastie <andrew@ahastie.net>; +Cc: pgsql-jdbc

On 3 October 2011 22:31, Andrew Hastie <andrew@ahastie.net> wrote:

> 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

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

If you use E''-style strings it will be less version-dependent - that
syntax was added a while back (in 8.1?)

Oliver



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: OpenJPA problems running against PG 8.1
@ 2011-10-04 02:37  Craig Ringer <ringerc@ringerc.id.au>
  parent: Andrew Hastie <andrew@ahastie.net>
  0 siblings, 1 reply; 6+ messages in thread

From: Craig Ringer @ 2011-10-04 02:37 UTC (permalink / raw)
  To: Andrew Hastie <andrew@ahastie.net>; +Cc: pgsql-jdbc

On 03/10/11 18:14, Andrew Hastie wrote:

> 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 '\\')

That's to do with standards_confirming_strings; \ is no longer an escape
by default, so '\\' is being interpreted as literally \\ instead of an
escaped '\'. Until OpenJPA is updated to recognise this, just SET
standards_conforming_strings=off or configure it in postgresql.conf .

--
Craig Ringer



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: OpenJPA problems running against PG 8.1
@ 2011-10-04 10:58  Andrew Hastie <andrew@ahastie.net>
  parent: Craig Ringer <ringerc@ringerc.id.au>
  0 siblings, 0 replies; 6+ messages in thread

From: Andrew Hastie @ 2011-10-04 10:58 UTC (permalink / raw)
  To: pgsql-jdbc

OpenJPA incident now logged:-

   https://issues.apache.org/jira/browse/OPENJPA-2056

Andrew



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2011-10-04 10:58 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-10-03 09:31 OpenJPA problems running against PG 8.1 Andrew Hastie <andrew@ahastie.net>
2011-10-03 10:17 ` Andrew Hastie <andrew@ahastie.net>
2011-10-03 10:27 ` Oliver Jowett <oliver@opencloud.com>
2011-10-03 10:14 OpenJPA problems running against PG 8.1 Andrew Hastie <andrew@ahastie.net>
2011-10-04 02:37 ` Craig Ringer <ringerc@ringerc.id.au>
2011-10-04 10:58   ` Andrew Hastie <andrew@ahastie.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox