History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: JBPAPP-219
Type: Bug Bug
Status: Closed Closed
Resolution: Done
Priority: Major Major
Assignee: Shelly McGowan
Reporter: Shelly McGowan
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JBoss Enterprise Platform App Edition

Query using Escape syntax in LIKE expression with PostgresSQL 8.2 results in PSQLException: The column index is out of range

Created: 15/Jun/07 03:54 PM   Updated: 30/Aug/07 04:53 PM
Component/s: Hibernate
Affects Version/s: 4.2.RC6
Fix Version/s: 4.2.0.GA
Security Level: Public (Everyone can see)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: PostgresSQL 8.2



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order:
Alex Pinkin [15/Jun/07 05:15 PM]
Steve, can you document the workaround please ASAP? We need to release note this.

Steve Ebersole [15/Jun/07 06:02 PM]
Well that depends on exactly what you are looking for.

If you mean in terms of the TCK, then there really is no workaround; we will always have this failure on PostgreSQL (perhaps until 8.4 according to Tom Lane).

If you mean from an end user perspective, this falls into the category of writing "portable" HQL/JPA-QL; basically: chose an escape character that's not problematic on any database.

Fernando Nasser [18/Jun/07 10:42 AM]
No Steve, we want a paragraph to add in the release notes to warn a customer about this problem with escape syntax in LIKE clauses, in case they try and do that with a PGSQL 8.2. Something like 1) what they should avoid 2) an alternative way of doing it. Perhaps something from your discussions with Tom?

Steve Ebersole [18/Jun/07 05:29 PM]
As we discussed on irc this morning...

There are certain "escape characters" you'll want to avoid in the interest of portability amongst different database vendors. The back-slash ('\'), for example, has special meaning on PostgreSQL (and possible other databases as well) and cannot be used in an escape sequence as it can on other databases. Instead, chose an escape character that is reasonably safe on all databases, like a "pipe" ('|').

Alex Pinkin [18/Jun/07 06:21 PM]
Josh, Steve provided description for the release notes

Joshua Wulf [19/Jun/07 01:45 PM]
I've added this issue to the release notes.

Patrick Macdonald [25/Jun/07 11:14 AM]
Resolved via release notes

Shelly McGowan [30/Aug/07 04:53 PM]
retried this test avoiding the use of the backslash as the escape character and the query worked as expected. Closing as this was what the release note suggested with PostgresSQL.