I got the following column:
full_path "gorfs"."absolute_pathname"
It keeps the path of a BLOB, like on the example below:
Note that the 4865
is the account_id
.The path is always like: /userfiles/account/ACCOUNTID
I need to extract that, to use in another query. For example:
select * from gorfs.seg WHERE account_id = 4865
How can I extract that value from the full_path
column?
Best Answer
If the account id is always at the third position use
split_part()
Note that due to the leading
/
the actual index is 4, not 3.The following query:
returns
If you want to put that into a view, you can use: