How to parse the URL in PostgreSQL
In this post, I am sharing a small demonstration on how to parse the URL in PostgreSQL.
Recently, I was working on python project where I needed URL parsing for Amazon S3 file web address.
At the same time, one of the database developers also needed URL parsing in PostgreSQL.
So sharing a small example on this which I studied from the official page of PostgreSQL.
Database Developer can use ts_debug for URL Parsing. In the result, we can get protocol, URL, host, url_path.
Check the below example:
1 2 3 4 5 | SELECT alias ,description ,token FROM ts_debug('https://https://postgresqldbaadmin.blogspot.com/2024/01/postgresql-log-the-drop-table-statement/'); |
Result:
No comments:
Post a Comment