Skip to content

pg_html5_email_address

PostgreSQL email validation that is consistent with the HTML5 spec

pg_html5_email_address · PostgreSQL email validation that is consistent with the HTML5 spec

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
4190pg_html5_email_addresspg_html5_email_address1.2.3UTILPostgreSQLSQL
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
----d-rNoNoNoYesyesno

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY1.2.319 18 17 16 15pg_html5_email_address-
RPMPIGSTY1.2.319 18 17 16 15pg_html5_email_address_$v-
DEBPIGSTY1.2.319 18 17 16 15postgresql-$v-pg-html5-email-address-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3
el8.aarch64N/APIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3
el9.x86_64PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3
el9.aarch64PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3
el10.x86_64PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3
el10.aarch64PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3
d12.x86_64PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3
d12.aarch64PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3
d13.x86_64PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3
d13.aarch64PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3
u22.x86_64PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3
u22.aarch64PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3
u24.x86_64PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3
u24.aarch64PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3
u26.x86_64PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3
u26.aarch64PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3PIGSTY 1.2.3
PackageVersionOSORGSIZEFile URL
pg_html5_email_address_191.2.3el9.x86_64pigsty15.3 KiBpg_html5_email_address_19-1.2.3-1PGSTY.el9.noarch.rpm
pg_html5_email_address_191.2.3el9.aarch64pigsty15.3 KiBpg_html5_email_address_19-1.2.3-1PGSTY.el9.noarch.rpm
pg_html5_email_address_191.2.3el10.x86_64pigsty15.5 KiBpg_html5_email_address_19-1.2.3-1PGSTY.el10.noarch.rpm
pg_html5_email_address_191.2.3el10.aarch64pigsty15.5 KiBpg_html5_email_address_19-1.2.3-1PGSTY.el10.noarch.rpm
postgresql-19-pg-html5-email-address1.2.3d12.x86_64pigsty12.3 KiBpostgresql-19-pg-html5-email-address_1.2.3-1PGSTY~bookworm_all.deb
postgresql-19-pg-html5-email-address1.2.3d12.aarch64pigsty12.3 KiBpostgresql-19-pg-html5-email-address_1.2.3-1PGSTY~bookworm_all.deb
postgresql-19-pg-html5-email-address1.2.3d13.x86_64pigsty12.3 KiBpostgresql-19-pg-html5-email-address_1.2.3-1PGSTY~trixie_all.deb
postgresql-19-pg-html5-email-address1.2.3d13.aarch64pigsty12.3 KiBpostgresql-19-pg-html5-email-address_1.2.3-1PGSTY~trixie_all.deb
postgresql-19-pg-html5-email-address1.2.3u22.x86_64pigsty12.6 KiBpostgresql-19-pg-html5-email-address_1.2.3-1PGSTY~jammy_all.deb
postgresql-19-pg-html5-email-address1.2.3u22.aarch64pigsty12.6 KiBpostgresql-19-pg-html5-email-address_1.2.3-1PGSTY~jammy_all.deb
postgresql-19-pg-html5-email-address1.2.3u24.x86_64pigsty12.6 KiBpostgresql-19-pg-html5-email-address_1.2.3-1PGSTY~noble_all.deb
postgresql-19-pg-html5-email-address1.2.3u24.aarch64pigsty12.6 KiBpostgresql-19-pg-html5-email-address_1.2.3-1PGSTY~noble_all.deb
postgresql-19-pg-html5-email-address1.2.3u26.x86_64pigsty12.6 KiBpostgresql-19-pg-html5-email-address_1.2.3-1PGSTY~resolute_all.deb
postgresql-19-pg-html5-email-address1.2.3u26.aarch64pigsty12.6 KiBpostgresql-19-pg-html5-email-address_1.2.3-1PGSTY~resolute_all.deb
PackageVersionOSORGSIZEFile URL
pg_html5_email_address_181.2.3el8.x86_64pigsty15.4 KiBpg_html5_email_address_18-1.2.3-1PGSTY.el8.noarch.rpm
pg_html5_email_address_181.2.3el8.aarch64pigsty15.4 KiBpg_html5_email_address_18-1.2.3-1PGSTY.el8.noarch.rpm
pg_html5_email_address_181.2.3el9.x86_64pigsty15.3 KiBpg_html5_email_address_18-1.2.3-1PGSTY.el9.noarch.rpm
pg_html5_email_address_181.2.3el9.aarch64pigsty15.3 KiBpg_html5_email_address_18-1.2.3-1PGSTY.el9.noarch.rpm
pg_html5_email_address_181.2.3el10.x86_64pigsty15.5 KiBpg_html5_email_address_18-1.2.3-1PGSTY.el10.noarch.rpm
pg_html5_email_address_181.2.3el10.aarch64pigsty15.5 KiBpg_html5_email_address_18-1.2.3-1PGSTY.el10.noarch.rpm
postgresql-18-pg-html5-email-address1.2.3d12.x86_64pigsty12.3 KiBpostgresql-18-pg-html5-email-address_1.2.3-1PGSTY~bookworm_all.deb
postgresql-18-pg-html5-email-address1.2.3d12.aarch64pigsty12.3 KiBpostgresql-18-pg-html5-email-address_1.2.3-1PGSTY~bookworm_all.deb
postgresql-18-pg-html5-email-address1.2.3d13.x86_64pigsty12.3 KiBpostgresql-18-pg-html5-email-address_1.2.3-1PGSTY~trixie_all.deb
postgresql-18-pg-html5-email-address1.2.3d13.aarch64pigsty12.3 KiBpostgresql-18-pg-html5-email-address_1.2.3-1PGSTY~trixie_all.deb
postgresql-18-pg-html5-email-address1.2.3u22.x86_64pigsty12.6 KiBpostgresql-18-pg-html5-email-address_1.2.3-1PGSTY~jammy_all.deb
postgresql-18-pg-html5-email-address1.2.3u22.aarch64pigsty12.6 KiBpostgresql-18-pg-html5-email-address_1.2.3-1PGSTY~jammy_all.deb
postgresql-18-pg-html5-email-address1.2.3u24.x86_64pigsty12.6 KiBpostgresql-18-pg-html5-email-address_1.2.3-1PGSTY~noble_all.deb
postgresql-18-pg-html5-email-address1.2.3u24.aarch64pigsty12.6 KiBpostgresql-18-pg-html5-email-address_1.2.3-1PGSTY~noble_all.deb
postgresql-18-pg-html5-email-address1.2.3u26.x86_64pigsty12.6 KiBpostgresql-18-pg-html5-email-address_1.2.3-1PGSTY~resolute_all.deb
postgresql-18-pg-html5-email-address1.2.3u26.aarch64pigsty12.6 KiBpostgresql-18-pg-html5-email-address_1.2.3-1PGSTY~resolute_all.deb
PackageVersionOSORGSIZEFile URL
pg_html5_email_address_171.2.3el8.x86_64pigsty15.4 KiBpg_html5_email_address_17-1.2.3-1PGSTY.el8.noarch.rpm
pg_html5_email_address_171.2.3el8.aarch64pigsty15.4 KiBpg_html5_email_address_17-1.2.3-1PGSTY.el8.noarch.rpm
pg_html5_email_address_171.2.3el9.x86_64pigsty15.3 KiBpg_html5_email_address_17-1.2.3-1PGSTY.el9.noarch.rpm
pg_html5_email_address_171.2.3el9.aarch64pigsty15.3 KiBpg_html5_email_address_17-1.2.3-1PGSTY.el9.noarch.rpm
pg_html5_email_address_171.2.3el10.x86_64pigsty15.5 KiBpg_html5_email_address_17-1.2.3-1PGSTY.el10.noarch.rpm
pg_html5_email_address_171.2.3el10.aarch64pigsty15.5 KiBpg_html5_email_address_17-1.2.3-1PGSTY.el10.noarch.rpm
postgresql-17-pg-html5-email-address1.2.3d12.x86_64pigsty12.3 KiBpostgresql-17-pg-html5-email-address_1.2.3-1PGSTY~bookworm_all.deb
postgresql-17-pg-html5-email-address1.2.3d12.aarch64pigsty12.3 KiBpostgresql-17-pg-html5-email-address_1.2.3-1PGSTY~bookworm_all.deb
postgresql-17-pg-html5-email-address1.2.3d13.x86_64pigsty12.3 KiBpostgresql-17-pg-html5-email-address_1.2.3-1PGSTY~trixie_all.deb
postgresql-17-pg-html5-email-address1.2.3d13.aarch64pigsty12.3 KiBpostgresql-17-pg-html5-email-address_1.2.3-1PGSTY~trixie_all.deb
postgresql-17-pg-html5-email-address1.2.3u22.x86_64pigsty12.6 KiBpostgresql-17-pg-html5-email-address_1.2.3-1PGSTY~jammy_all.deb
postgresql-17-pg-html5-email-address1.2.3u22.aarch64pigsty12.6 KiBpostgresql-17-pg-html5-email-address_1.2.3-1PGSTY~jammy_all.deb
postgresql-17-pg-html5-email-address1.2.3u24.x86_64pigsty12.6 KiBpostgresql-17-pg-html5-email-address_1.2.3-1PGSTY~noble_all.deb
postgresql-17-pg-html5-email-address1.2.3u24.aarch64pigsty12.6 KiBpostgresql-17-pg-html5-email-address_1.2.3-1PGSTY~noble_all.deb
postgresql-17-pg-html5-email-address1.2.3u26.x86_64pigsty12.6 KiBpostgresql-17-pg-html5-email-address_1.2.3-1PGSTY~resolute_all.deb
postgresql-17-pg-html5-email-address1.2.3u26.aarch64pigsty12.6 KiBpostgresql-17-pg-html5-email-address_1.2.3-1PGSTY~resolute_all.deb
PackageVersionOSORGSIZEFile URL
pg_html5_email_address_161.2.3el8.x86_64pigsty15.4 KiBpg_html5_email_address_16-1.2.3-1PGSTY.el8.noarch.rpm
pg_html5_email_address_161.2.3el8.aarch64pigsty15.4 KiBpg_html5_email_address_16-1.2.3-1PGSTY.el8.noarch.rpm
pg_html5_email_address_161.2.3el9.x86_64pigsty15.3 KiBpg_html5_email_address_16-1.2.3-1PGSTY.el9.noarch.rpm
pg_html5_email_address_161.2.3el9.aarch64pigsty15.3 KiBpg_html5_email_address_16-1.2.3-1PGSTY.el9.noarch.rpm
pg_html5_email_address_161.2.3el10.x86_64pigsty15.5 KiBpg_html5_email_address_16-1.2.3-1PGSTY.el10.noarch.rpm
pg_html5_email_address_161.2.3el10.aarch64pigsty15.5 KiBpg_html5_email_address_16-1.2.3-1PGSTY.el10.noarch.rpm
postgresql-16-pg-html5-email-address1.2.3d12.x86_64pigsty12.3 KiBpostgresql-16-pg-html5-email-address_1.2.3-1PGSTY~bookworm_all.deb
postgresql-16-pg-html5-email-address1.2.3d12.aarch64pigsty12.3 KiBpostgresql-16-pg-html5-email-address_1.2.3-1PGSTY~bookworm_all.deb
postgresql-16-pg-html5-email-address1.2.3d13.x86_64pigsty12.3 KiBpostgresql-16-pg-html5-email-address_1.2.3-1PGSTY~trixie_all.deb
postgresql-16-pg-html5-email-address1.2.3d13.aarch64pigsty12.3 KiBpostgresql-16-pg-html5-email-address_1.2.3-1PGSTY~trixie_all.deb
postgresql-16-pg-html5-email-address1.2.3u22.x86_64pigsty12.6 KiBpostgresql-16-pg-html5-email-address_1.2.3-1PGSTY~jammy_all.deb
postgresql-16-pg-html5-email-address1.2.3u22.aarch64pigsty12.6 KiBpostgresql-16-pg-html5-email-address_1.2.3-1PGSTY~jammy_all.deb
postgresql-16-pg-html5-email-address1.2.3u24.x86_64pigsty12.6 KiBpostgresql-16-pg-html5-email-address_1.2.3-1PGSTY~noble_all.deb
postgresql-16-pg-html5-email-address1.2.3u24.aarch64pigsty12.6 KiBpostgresql-16-pg-html5-email-address_1.2.3-1PGSTY~noble_all.deb
postgresql-16-pg-html5-email-address1.2.3u26.x86_64pigsty12.6 KiBpostgresql-16-pg-html5-email-address_1.2.3-1PGSTY~resolute_all.deb
postgresql-16-pg-html5-email-address1.2.3u26.aarch64pigsty12.6 KiBpostgresql-16-pg-html5-email-address_1.2.3-1PGSTY~resolute_all.deb
PackageVersionOSORGSIZEFile URL
pg_html5_email_address_151.2.3el8.x86_64pigsty15.4 KiBpg_html5_email_address_15-1.2.3-1PGSTY.el8.noarch.rpm
pg_html5_email_address_151.2.3el8.aarch64pigsty15.4 KiBpg_html5_email_address_15-1.2.3-1PGSTY.el8.noarch.rpm
pg_html5_email_address_151.2.3el9.x86_64pigsty15.3 KiBpg_html5_email_address_15-1.2.3-1PGSTY.el9.noarch.rpm
pg_html5_email_address_151.2.3el9.aarch64pigsty15.3 KiBpg_html5_email_address_15-1.2.3-1PGSTY.el9.noarch.rpm
pg_html5_email_address_151.2.3el10.x86_64pigsty15.5 KiBpg_html5_email_address_15-1.2.3-1PGSTY.el10.noarch.rpm
pg_html5_email_address_151.2.3el10.aarch64pigsty15.5 KiBpg_html5_email_address_15-1.2.3-1PGSTY.el10.noarch.rpm
postgresql-15-pg-html5-email-address1.2.3d12.x86_64pigsty12.3 KiBpostgresql-15-pg-html5-email-address_1.2.3-1PGSTY~bookworm_all.deb
postgresql-15-pg-html5-email-address1.2.3d12.aarch64pigsty12.3 KiBpostgresql-15-pg-html5-email-address_1.2.3-1PGSTY~bookworm_all.deb
postgresql-15-pg-html5-email-address1.2.3d13.x86_64pigsty12.3 KiBpostgresql-15-pg-html5-email-address_1.2.3-1PGSTY~trixie_all.deb
postgresql-15-pg-html5-email-address1.2.3d13.aarch64pigsty12.3 KiBpostgresql-15-pg-html5-email-address_1.2.3-1PGSTY~trixie_all.deb
postgresql-15-pg-html5-email-address1.2.3u22.x86_64pigsty12.6 KiBpostgresql-15-pg-html5-email-address_1.2.3-1PGSTY~jammy_all.deb
postgresql-15-pg-html5-email-address1.2.3u22.aarch64pigsty12.6 KiBpostgresql-15-pg-html5-email-address_1.2.3-1PGSTY~jammy_all.deb
postgresql-15-pg-html5-email-address1.2.3u24.x86_64pigsty12.6 KiBpostgresql-15-pg-html5-email-address_1.2.3-1PGSTY~noble_all.deb
postgresql-15-pg-html5-email-address1.2.3u24.aarch64pigsty12.6 KiBpostgresql-15-pg-html5-email-address_1.2.3-1PGSTY~noble_all.deb
postgresql-15-pg-html5-email-address1.2.3u26.x86_64pigsty12.6 KiBpostgresql-15-pg-html5-email-address_1.2.3-1PGSTY~resolute_all.deb
postgresql-15-pg-html5-email-address1.2.3u26.aarch64pigsty12.6 KiBpostgresql-15-pg-html5-email-address_1.2.3-1PGSTY~resolute_all.deb

Source

github.com/bigsmoke/pg_html5_email_address

pig build pkg pg_html5_email_address;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install pg_html5_email_address;		# install by package name

pig install pg_html5_email_address -v 19;   # install for PG 19
pig install pg_html5_email_address -v 18;   # install for PG 18
pig install pg_html5_email_address -v 17;   # install for PG 17
pig install pg_html5_email_address -v 16;   # install for PG 16
pig install pg_html5_email_address -v 15;   # install for PG 15

Create this extension with:

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 'user@example.com'::html5_email;

-- Case-insensitive equality:
SELECT 'User@Example.com'::html5_email = 'user@example.com'::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 'user@example.com' ~ html5_email_regexp();
-- t

SELECT 'user @example.com' ~ html5_email_regexp();
-- f

With optional capturing groups for local and domain parts:

SELECT (regexp_matches('user@example.com', html5_email_regexp(true)))[1];
-- 'user'
SELECT (regexp_matches('user@example.com', 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

Table reader