Extract Main Domain from URLs in PostgreSQL Without Subdomains, Ports, or Query Parameters
I’m working with a PostgreSQL query where I need to extract the main domain (including the second-level domain and top-level domain) from URLs. However, the current approach using REGEXP_MATCH or SUBSTRING doesn’t handle all cases correctly. For example, it fails to parse URLs like {www.paylink.fr:443} (which should be paylink.fr) and {api.ornage.com} (which should be ornage.com)
How to Parse a field with Pattern “userid-date-amount” in postgresql
I’m working on a query where I need to parse Description field that follow the pattern “userid-date-amount-” For example, a valid value would be: 222826-2022/07/26-32,700,000-
postgresql : How can I find the the rows having non-printable characters in my table?
I have a database table which has some values with non-printable character, my question is how to find the rows having those characters. Is there any way to create the select query on some columns and use a regex to find the rows?