DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Andy Jefferson
Reporter: KC Berg
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

Support for PostgreSQL's "SIMILAR TO" operator

Created: 03/Feb/11 09:24 PM   Updated: 07/Mar/11 05:37 PM   Resolved: 24/Feb/11 05:41 PM
Component/s: Queries
Affects Version/s: 2.2.2, 3.0.0.m1
Fix Version/s: 3.0.0.m2

File Attachments: 1. Java Source File (3 kB)

Environment: Postgresql 8.4 and up

Forum Thread URL:,6522
Datastore: PostgreSQL
Severity: Production

 Description  « Hide
Using String.matches against Postgresql doesn't support all regex patterns. This is due to postgresql using the "SIMILAR TO" operator for advanced regex and not the "LIKE" operator. See postgresql docs for more info:

KC Berg added a comment - 03/Feb/11 09:26 PM
I've attached a patch for this issue but it fails one of the unit tests, see forum link for details. When I figure out a way to support the unit test case I'll upload a new patch, but I figured I'd upload what I currently have so others may use it, as it is working well in my environment.

KC Berg made changes - 03/Feb/11 09:26 PM
Field Original Value New Value
Attachment [ 11351 ]
Andy Jefferson added a comment - 24/Feb/11 05:41 PM
Added to SVN (3.0) as mapping to the JDOQL syntax
so it is accessible for postgresql under that name. If you find a way of allowing it as a default "String.matches" then raise a new JIRA with a patch for the changes.

Andy Jefferson made changes - 24/Feb/11 05:41 PM
Status Open [ 1 ] Resolved [ 5 ]
Assignee Andy Jefferson [ andy ]
Fix Version/s 3.0.0.m2 [ 11151 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 07/Mar/11 05:37 PM
Status Resolved [ 5 ] Closed [ 6 ]