emailaddr

Email address type for PostgreSQL

Overview

PackageVersionCategoryLicenseLanguage
pg_emailaddr0TYPEPostgreSQLC
IDExtensionBinLibLoadCreateTrustRelocSchema
3850emailaddrNoYesNoYesNoNo-
Relatedprefix semver unit pgpdf pglite_fusion md5hash asn1oid roaringbitmap

+varatt.h

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY01817161514pg_emailaddr-
RPMPIGSTY01817161514pg_emailaddr_$v-
DEBPIGSTY01817161514postgresql-$v-pg-emailaddr-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
el8.aarch64
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
el9.x86_64
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
el9.aarch64
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
el10.x86_64
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
el10.aarch64
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
d12.x86_64
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
d12.aarch64
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
d13.x86_64
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
d13.aarch64
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
u22.x86_64
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
u22.aarch64
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
u24.x86_64
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
u24.aarch64
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0
PIGSTY 0

Build

You can build the RPM / DEB packages for pg_emailaddr using pig build:

pig build pkg pg_emailaddr         # build RPM / DEB packages

Install

You can install pg_emailaddr 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_emailaddr;          # Install for current active PG version
pig ext install -y pg_emailaddr -v 18  # PG 18
pig ext install -y pg_emailaddr -v 17  # PG 17
pig ext install -y pg_emailaddr -v 16  # PG 16
pig ext install -y pg_emailaddr -v 15  # PG 15
pig ext install -y pg_emailaddr -v 14  # PG 14
dnf install -y pg_emailaddr_18       # PG 18
dnf install -y pg_emailaddr_17       # PG 17
dnf install -y pg_emailaddr_16       # PG 16
dnf install -y pg_emailaddr_15       # PG 15
dnf install -y pg_emailaddr_14       # PG 14
apt install -y postgresql-18-pg-emailaddr   # PG 18
apt install -y postgresql-17-pg-emailaddr   # PG 17
apt install -y postgresql-16-pg-emailaddr   # PG 16
apt install -y postgresql-15-pg-emailaddr   # PG 15
apt install -y postgresql-14-pg-emailaddr   # PG 14

Create Extension:

CREATE EXTENSION emailaddr;

Usage

emailaddr: email address data type for PostgreSQL

The emailaddr extension provides a data type for storing and validating email addresses conforming to the addr-spec format defined in RFC 5322.

CREATE EXTENSION emailaddr;

CREATE TABLE accounts (
    id    int PRIMARY KEY,
    name  text,
    email emailaddr
);

INSERT INTO accounts VALUES (1, 'Peter Eisentraut', '[email protected]');

Data Type

The emailaddr type validates email addresses on input according to RFC 5322 addr-spec rules. Simple formats like [email protected] are accepted. Display name syntax such as "User Name" <[email protected]> is not supported.

Operators

Standard comparison operators are supported: =, <>, <, >, <=, >=.

Index Support

Btree indexes are available for efficient lookups and sorting on emailaddr columns.


Last Modified 2026-03-12: add pg extension catalog (95749bf)