Provides a specialized data type for storing and validating email addresses.
emailaddr
extension already installed and enabled.
contacts
Tableemailaddr
, let’s create a sample table to store email addresses of key contacts:
EMAILADDR
is a specialized type, queries can be performed as with standard text columns:
emailaddr
type ensures that only valid email addresses are stored. For example, the following insertion will fail:
'not_an_email'
is not a properly formatted email address.
EMAILADDR
ensures correct email formatting but does not verify if the email exists.emailaddr
extension in PostgreSQL simplifies email validation and storage while ensuring efficient indexing for lookup queries.
For more details, refer to the official PostgreSQL documentation or community resources.