pg_html5_email_address
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_html5_email_address | 1.2.3 | UTIL | PostgreSQL | SQL |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4180 | pg_html5_email_address | No | No | No | Yes | No | Yes | - |
| Related | pg_smtp_client url_encode pg_render gzip bzip zstd http pg_net |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.2.3 | 1817161514 | pg_html5_email_address | - |
| RPM | PIGSTY | 1.2.3 | 1817161514 | pg_html5_email_address_$v | - |
| DEB | PIGSTY | 1.2.3 | 1817161514 | postgresql-$v-pg-html5-email-address | - |
Build
You can build the RPM / DEB packages for pg_html5_email_address using pig build:
pig build pkg pg_html5_email_address # build RPM / DEB packages
Install
You can install pg_html5_email_address directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pg_html5_email_address; # Install for current active PG version
pig ext install -y pg_html5_email_address -v 18 # PG 18
pig ext install -y pg_html5_email_address -v 17 # PG 17
pig ext install -y pg_html5_email_address -v 16 # PG 16
pig ext install -y pg_html5_email_address -v 15 # PG 15
pig ext install -y pg_html5_email_address -v 14 # PG 14
dnf install -y pg_html5_email_address_18 # PG 18
dnf install -y pg_html5_email_address_17 # PG 17
dnf install -y pg_html5_email_address_16 # PG 16
dnf install -y pg_html5_email_address_15 # PG 15
dnf install -y pg_html5_email_address_14 # PG 14
apt install -y postgresql-18-pg-html5-email-address # PG 18
apt install -y postgresql-17-pg-html5-email-address # PG 17
apt install -y postgresql-16-pg-html5-email-address # PG 16
apt install -y postgresql-15-pg-html5-email-address # PG 15
apt install -y postgresql-14-pg-html5-email-address # PG 14
Create Extension:
CREATE EXTENSION pg_html5_email_address;
Usage
pg_html5_email_address: HTML5 email address validation for PostgreSQL
Provides email address validation consistent with the HTML5 <input type="email"> specification.
Domain Type: html5_email
A domain type that enforces HTML5 email validation rules with case-insensitive comparison:
SELECT '[email protected]'::html5_email;
-- Case-insensitive equality:
SELECT '[email protected]'::html5_email = '[email protected]'::html5_email;
-- t
-- Invalid emails raise check_violation:
SELECT 'user @example.com'::html5_email;
-- ERROR: check_violation
Function: html5_email_regexp()
Returns a regex matching valid HTML5 email addresses:
-- Check if a string is a valid HTML5 email
SELECT '[email protected]' ~ html5_email_regexp();
-- t
SELECT 'user @example.com' ~ html5_email_regexp();
-- f
With optional capturing groups for local and domain parts:
SELECT (regexp_matches('[email protected]', html5_email_regexp(true)))[1];
-- 'user'
SELECT (regexp_matches('[email protected]', html5_email_regexp(true)))[2];
-- 'example.com'
Validation Rules
- Spaces are not allowed
- Non-ASCII characters are not allowed (neither in local nor domain part)
- There must be something after the
@ - Special characters like
!#$%&'*+/=?^_{|}~-` are allowed in the local part
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.