I am new to Postgres and would like to learn how to split multiple email address at once and the final table ouput would have 3 columns username, domain, extension.
For example I have multiple email address.
[email protected]
and so forth
I need an output on the table like this.
username | domain | extension |
---|---|---|
robert bryne | gmail | com |
Also, how do I insert into with all of this select results in my table.
2
Answers
You could try to use REGEXP_MATCHES to match email address, then retrieve each email part in matched result.
Demo
You can use split_part