Pattern matching not working on different version of PostgreSQL

248 Views Asked by At

I am trying to match a string pattern with my regex '^\\d[0-9]*\/\d[0-9]*\/\d[0-9]*' while fetching data from query. It is working fine on PostgreSQL version 9.5.4 but not working with version 9.0.4 which is my production server.

What amendments do I need to do in regex to make it compatible with PostgreSQL version 9.0.4?

Query:

Select * from table where column_name ~ '^\d[0-9]*\/\d[0-9]*\/\d[0-9]*'

I tried E'^\\d[0-9]*\/\d[0-9]*\/\d[0-9]*' as suggested in postgres doc (https://www.postgresql.org/docs/9.0/static/functions-matching.html) but its not working.

0

There are 0 best solutions below