I am trying to do something which I am not sure is possible or not.
So here it is, I have one data set in my PostgreSQL table:
select * from company;
id | name | age |
----+------------------+-----+-
2 | Spine_[1-9]_Leaf | 12 |
So basically I am storing a regular expression in name in the database.
It means if we pass in the query any value like Spine_1_Leaf ... Spine_9_Leaf, it should return the record:
2 | Spine_[1-9]_Leaf | 12 |
because name string matches name (regex from the db). Please do let me know how can we make it possible. I am trying things like:
select * from company where name ~ 'Spine_1_Leaf'
Which is not working (and it should not be also).