I am trying to extract a substring from a text string in postgresql. The column name of the text string is URL and I am using the subtring function to define a regex that will return only the portion that I want:
SELECT
substring('user_latitude=.*user_' from URL)
FROM my_table
limit 10
When I execute this query, I am greeted with the following response:
SQL Error [XX000]: ERROR: Not implemented Detail:
error: Not implemented code: 1001 context: 'false' - Function substring(text,text) not implemented - use REGEXP_SUBSTR instead query: 258128 location: cg_expr.cpp:4265 process: padbmaster [pid=52019]
org.postgresql.util.PSQLException: ERROR: Not implemented Detail:
error: Not implemented code: 1001 context: 'false' - Function substring(text,text) not implemented - use >REGEXP_SUBSTR instead query: 258128 location: cg_expr.cpp:4265 process: padbmaster [pid=52019]
However, REGEXP_SUBSTR does not appear to be a native function, and does not work.
Is there a way to extract a value from a string in POSTGRES?
Thanks