-1

Let's say I have the follwing column in Postgres:

Id | Column
----------------
1  | AB1234
2  | DE123456
3  | 123456A
4  | 123 A 456
5  | 987654-123
6  | \documents

The query I have only outputs id 6, but I need it to output ids 2,3,5:

SELECT * FROM table WHERE Column SIMILAR TO '%(\d{5,})%'
joseagaleanoc
  • 527
  • 1
  • 7
  • 19

1 Answers1

0

I got it to work with:

SELECT * FROM table WHERE Column SIMILAR TO '%[0-9]{5,}%'

The query on the question for some unknown reason takes \d as a literal string

joseagaleanoc
  • 527
  • 1
  • 7
  • 19