I have a list of paths in Postgres:
/approve/optimal/roadmap/
/approve/optimal/roadmap/payments/
/approve/optimal/roadmap/payments/benefits/
/approve/optimal/roadmap/payments/healthcare/
I'd like a regex that will get the direct descendent of /approve/optimal/roadmap/ (ie: /approve/optimal/roadmap/payments/, but nothing else)
I have looked at the ~ operator, but can't seem to make it work with POSIX regex.
SELECT * FROM table WHERE path ~ '/approve/optimal/roadmap/.+?/^.+/'
If this is possible without regex, I'd love to implement THAT solution, as regex just gives me a headache.