Skip to content

edtf_postgres

EDTF validation, normalization, date bounds, and temporal relations

edtf_postgres · EDTF validation, normalization, date bounds, and temporal relations

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
1130edtf_postgresedtf_postgres2.0.0TIMEMITRust
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-dtrNoYesNoYesyesyes
Relationships
See Alsopg_when pgcalendar pg_rrule pg_duration

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY2.0.019 18 17 16 15edtf_postgres-
RPMPIGSTY2.0.019 18 17 16 15edtf_postgres_$v-
DEBPIGSTY2.0.019 18 17 16 15postgresql-$v-edtf-postgres-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 1.3.2PIGSTY 1.3.2PIGSTY 1.3.2PIGSTY 1.3.2
el8.aarch64N/APIGSTY 1.3.2PIGSTY 1.3.2PIGSTY 1.3.2PIGSTY 1.3.2
el9.x86_64PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0
el9.aarch64PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0
el10.x86_64PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0
el10.aarch64PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0
d12.x86_64PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0
d12.aarch64PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0
d13.x86_64PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0
d13.aarch64PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0
u22.x86_64PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0
u22.aarch64PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0
u24.x86_64PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0
u24.aarch64PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0
u26.x86_64PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0
u26.aarch64PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0PIGSTY 2.0.0
PackageVersionOSORGSIZEFile URL
edtf_postgres_192.0.0el9.x86_64pigsty1.6 MiBedtf_postgres_19-2.0.0-1PGSTY.el9.x86_64.rpm
edtf_postgres_192.0.0el9.aarch64pigsty1.6 MiBedtf_postgres_19-2.0.0-1PGSTY.el9.aarch64.rpm
edtf_postgres_192.0.0el10.x86_64pigsty1.5 MiBedtf_postgres_19-2.0.0-1PGSTY.el10.x86_64.rpm
edtf_postgres_192.0.0el10.aarch64pigsty1.6 MiBedtf_postgres_19-2.0.0-1PGSTY.el10.aarch64.rpm
postgresql-19-edtf-postgres2.0.0d12.x86_64pigsty1.2 MiBpostgresql-19-edtf-postgres_2.0.0-1PGSTY~bookworm_amd64.deb
postgresql-19-edtf-postgres2.0.0d12.aarch64pigsty1.1 MiBpostgresql-19-edtf-postgres_2.0.0-1PGSTY~bookworm_arm64.deb
postgresql-19-edtf-postgres2.0.0d13.x86_64pigsty1.2 MiBpostgresql-19-edtf-postgres_2.0.0-1PGSTY~trixie_amd64.deb
postgresql-19-edtf-postgres2.0.0d13.aarch64pigsty1.1 MiBpostgresql-19-edtf-postgres_2.0.0-1PGSTY~trixie_arm64.deb
postgresql-19-edtf-postgres2.0.0u22.x86_64pigsty1.3 MiBpostgresql-19-edtf-postgres_2.0.0-1PGSTY~jammy_amd64.deb
postgresql-19-edtf-postgres2.0.0u22.aarch64pigsty1.3 MiBpostgresql-19-edtf-postgres_2.0.0-1PGSTY~jammy_arm64.deb
postgresql-19-edtf-postgres2.0.0u24.x86_64pigsty1.3 MiBpostgresql-19-edtf-postgres_2.0.0-1PGSTY~noble_amd64.deb
postgresql-19-edtf-postgres2.0.0u24.aarch64pigsty1.2 MiBpostgresql-19-edtf-postgres_2.0.0-1PGSTY~noble_arm64.deb
postgresql-19-edtf-postgres2.0.0u26.x86_64pigsty1.3 MiBpostgresql-19-edtf-postgres_2.0.0-1PGSTY~resolute_amd64.deb
postgresql-19-edtf-postgres2.0.0u26.aarch64pigsty1.2 MiBpostgresql-19-edtf-postgres_2.0.0-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
edtf_postgres_181.3.2el8.x86_64pigsty1.6 MiBedtf_postgres_18-1.3.2-1PGSTY.el8.x86_64.rpm
edtf_postgres_181.3.2el8.aarch64pigsty1.5 MiBedtf_postgres_18-1.3.2-1PGSTY.el8.aarch64.rpm
edtf_postgres_182.0.0el9.x86_64pigsty1.5 MiBedtf_postgres_18-2.0.0-1PGSTY.el9.x86_64.rpm
edtf_postgres_182.0.0el9.aarch64pigsty1.6 MiBedtf_postgres_18-2.0.0-1PGSTY.el9.aarch64.rpm
edtf_postgres_182.0.0el10.x86_64pigsty1.5 MiBedtf_postgres_18-2.0.0-1PGSTY.el10.x86_64.rpm
edtf_postgres_182.0.0el10.aarch64pigsty1.6 MiBedtf_postgres_18-2.0.0-1PGSTY.el10.aarch64.rpm
postgresql-18-edtf-postgres2.0.0d12.x86_64pigsty1.2 MiBpostgresql-18-edtf-postgres_2.0.0-1PGSTY~bookworm_amd64.deb
postgresql-18-edtf-postgres2.0.0d12.aarch64pigsty1.0 MiBpostgresql-18-edtf-postgres_2.0.0-1PGSTY~bookworm_arm64.deb
postgresql-18-edtf-postgres2.0.0d13.x86_64pigsty1.2 MiBpostgresql-18-edtf-postgres_2.0.0-1PGSTY~trixie_amd64.deb
postgresql-18-edtf-postgres2.0.0d13.aarch64pigsty1.1 MiBpostgresql-18-edtf-postgres_2.0.0-1PGSTY~trixie_arm64.deb
postgresql-18-edtf-postgres2.0.0u22.x86_64pigsty1.3 MiBpostgresql-18-edtf-postgres_2.0.0-1PGSTY~jammy_amd64.deb
postgresql-18-edtf-postgres2.0.0u22.aarch64pigsty1.2 MiBpostgresql-18-edtf-postgres_2.0.0-1PGSTY~jammy_arm64.deb
postgresql-18-edtf-postgres2.0.0u24.x86_64pigsty1.3 MiBpostgresql-18-edtf-postgres_2.0.0-1PGSTY~noble_amd64.deb
postgresql-18-edtf-postgres2.0.0u24.aarch64pigsty1.2 MiBpostgresql-18-edtf-postgres_2.0.0-1PGSTY~noble_arm64.deb
postgresql-18-edtf-postgres2.0.0u26.x86_64pigsty1.3 MiBpostgresql-18-edtf-postgres_2.0.0-1PGSTY~resolute_amd64.deb
postgresql-18-edtf-postgres2.0.0u26.aarch64pigsty1.2 MiBpostgresql-18-edtf-postgres_2.0.0-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
edtf_postgres_171.3.2el8.x86_64pigsty1.6 MiBedtf_postgres_17-1.3.2-1PGSTY.el8.x86_64.rpm
edtf_postgres_171.3.2el8.aarch64pigsty1.5 MiBedtf_postgres_17-1.3.2-1PGSTY.el8.aarch64.rpm
edtf_postgres_172.0.0el9.x86_64pigsty1.5 MiBedtf_postgres_17-2.0.0-1PGSTY.el9.x86_64.rpm
edtf_postgres_172.0.0el9.aarch64pigsty1.6 MiBedtf_postgres_17-2.0.0-1PGSTY.el9.aarch64.rpm
edtf_postgres_172.0.0el10.x86_64pigsty1.5 MiBedtf_postgres_17-2.0.0-1PGSTY.el10.x86_64.rpm
edtf_postgres_172.0.0el10.aarch64pigsty1.6 MiBedtf_postgres_17-2.0.0-1PGSTY.el10.aarch64.rpm
postgresql-17-edtf-postgres2.0.0d12.x86_64pigsty1.2 MiBpostgresql-17-edtf-postgres_2.0.0-1PGSTY~bookworm_amd64.deb
postgresql-17-edtf-postgres2.0.0d12.aarch64pigsty1.0 MiBpostgresql-17-edtf-postgres_2.0.0-1PGSTY~bookworm_arm64.deb
postgresql-17-edtf-postgres2.0.0d13.x86_64pigsty1.2 MiBpostgresql-17-edtf-postgres_2.0.0-1PGSTY~trixie_amd64.deb
postgresql-17-edtf-postgres2.0.0d13.aarch64pigsty1.0 MiBpostgresql-17-edtf-postgres_2.0.0-1PGSTY~trixie_arm64.deb
postgresql-17-edtf-postgres2.0.0u22.x86_64pigsty1.3 MiBpostgresql-17-edtf-postgres_2.0.0-1PGSTY~jammy_amd64.deb
postgresql-17-edtf-postgres2.0.0u22.aarch64pigsty1.2 MiBpostgresql-17-edtf-postgres_2.0.0-1PGSTY~jammy_arm64.deb
postgresql-17-edtf-postgres2.0.0u24.x86_64pigsty1.3 MiBpostgresql-17-edtf-postgres_2.0.0-1PGSTY~noble_amd64.deb
postgresql-17-edtf-postgres2.0.0u24.aarch64pigsty1.2 MiBpostgresql-17-edtf-postgres_2.0.0-1PGSTY~noble_arm64.deb
postgresql-17-edtf-postgres2.0.0u26.x86_64pigsty1.3 MiBpostgresql-17-edtf-postgres_2.0.0-1PGSTY~resolute_amd64.deb
postgresql-17-edtf-postgres2.0.0u26.aarch64pigsty1.2 MiBpostgresql-17-edtf-postgres_2.0.0-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
edtf_postgres_161.3.2el8.x86_64pigsty1.5 MiBedtf_postgres_16-1.3.2-1PGSTY.el8.x86_64.rpm
edtf_postgres_161.3.2el8.aarch64pigsty1.5 MiBedtf_postgres_16-1.3.2-1PGSTY.el8.aarch64.rpm
edtf_postgres_162.0.0el9.x86_64pigsty1.5 MiBedtf_postgres_16-2.0.0-1PGSTY.el9.x86_64.rpm
edtf_postgres_162.0.0el9.aarch64pigsty1.6 MiBedtf_postgres_16-2.0.0-1PGSTY.el9.aarch64.rpm
edtf_postgres_162.0.0el10.x86_64pigsty1.5 MiBedtf_postgres_16-2.0.0-1PGSTY.el10.x86_64.rpm
edtf_postgres_162.0.0el10.aarch64pigsty1.6 MiBedtf_postgres_16-2.0.0-1PGSTY.el10.aarch64.rpm
postgresql-16-edtf-postgres2.0.0d12.x86_64pigsty1.2 MiBpostgresql-16-edtf-postgres_2.0.0-1PGSTY~bookworm_amd64.deb
postgresql-16-edtf-postgres2.0.0d12.aarch64pigsty1.0 MiBpostgresql-16-edtf-postgres_2.0.0-1PGSTY~bookworm_arm64.deb
postgresql-16-edtf-postgres2.0.0d13.x86_64pigsty1.2 MiBpostgresql-16-edtf-postgres_2.0.0-1PGSTY~trixie_amd64.deb
postgresql-16-edtf-postgres2.0.0d13.aarch64pigsty1.0 MiBpostgresql-16-edtf-postgres_2.0.0-1PGSTY~trixie_arm64.deb
postgresql-16-edtf-postgres2.0.0u22.x86_64pigsty1.3 MiBpostgresql-16-edtf-postgres_2.0.0-1PGSTY~jammy_amd64.deb
postgresql-16-edtf-postgres2.0.0u22.aarch64pigsty1.2 MiBpostgresql-16-edtf-postgres_2.0.0-1PGSTY~jammy_arm64.deb
postgresql-16-edtf-postgres2.0.0u24.x86_64pigsty1.3 MiBpostgresql-16-edtf-postgres_2.0.0-1PGSTY~noble_amd64.deb
postgresql-16-edtf-postgres2.0.0u24.aarch64pigsty1.2 MiBpostgresql-16-edtf-postgres_2.0.0-1PGSTY~noble_arm64.deb
postgresql-16-edtf-postgres2.0.0u26.x86_64pigsty1.3 MiBpostgresql-16-edtf-postgres_2.0.0-1PGSTY~resolute_amd64.deb
postgresql-16-edtf-postgres2.0.0u26.aarch64pigsty1.2 MiBpostgresql-16-edtf-postgres_2.0.0-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
edtf_postgres_151.3.2el8.x86_64pigsty1.5 MiBedtf_postgres_15-1.3.2-1PGSTY.el8.x86_64.rpm
edtf_postgres_151.3.2el8.aarch64pigsty1.5 MiBedtf_postgres_15-1.3.2-1PGSTY.el8.aarch64.rpm
edtf_postgres_152.0.0el9.x86_64pigsty1.5 MiBedtf_postgres_15-2.0.0-1PGSTY.el9.x86_64.rpm
edtf_postgres_152.0.0el9.aarch64pigsty1.6 MiBedtf_postgres_15-2.0.0-1PGSTY.el9.aarch64.rpm
edtf_postgres_152.0.0el10.x86_64pigsty1.5 MiBedtf_postgres_15-2.0.0-1PGSTY.el10.x86_64.rpm
edtf_postgres_152.0.0el10.aarch64pigsty1.6 MiBedtf_postgres_15-2.0.0-1PGSTY.el10.aarch64.rpm
postgresql-15-edtf-postgres2.0.0d12.x86_64pigsty1.2 MiBpostgresql-15-edtf-postgres_2.0.0-1PGSTY~bookworm_amd64.deb
postgresql-15-edtf-postgres2.0.0d12.aarch64pigsty1.0 MiBpostgresql-15-edtf-postgres_2.0.0-1PGSTY~bookworm_arm64.deb
postgresql-15-edtf-postgres2.0.0d13.x86_64pigsty1.2 MiBpostgresql-15-edtf-postgres_2.0.0-1PGSTY~trixie_amd64.deb
postgresql-15-edtf-postgres2.0.0d13.aarch64pigsty1.0 MiBpostgresql-15-edtf-postgres_2.0.0-1PGSTY~trixie_arm64.deb
postgresql-15-edtf-postgres2.0.0u22.x86_64pigsty1.3 MiBpostgresql-15-edtf-postgres_2.0.0-1PGSTY~jammy_amd64.deb
postgresql-15-edtf-postgres2.0.0u22.aarch64pigsty1.2 MiBpostgresql-15-edtf-postgres_2.0.0-1PGSTY~jammy_arm64.deb
postgresql-15-edtf-postgres2.0.0u24.x86_64pigsty1.3 MiBpostgresql-15-edtf-postgres_2.0.0-1PGSTY~noble_amd64.deb
postgresql-15-edtf-postgres2.0.0u24.aarch64pigsty1.2 MiBpostgresql-15-edtf-postgres_2.0.0-1PGSTY~noble_arm64.deb
postgresql-15-edtf-postgres2.0.0u26.x86_64pigsty1.3 MiBpostgresql-15-edtf-postgres_2.0.0-1PGSTY~resolute_amd64.deb
postgresql-15-edtf-postgres2.0.0u26.aarch64pigsty1.2 MiBpostgresql-15-edtf-postgres_2.0.0-1PGSTY~resolute_arm64.deb

Source

github.com/monumental-archive/edtf/tree/v2.0.0/crates/edtf-postgres

pig build pkg edtf_postgres;		# 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 edtf_postgres;		# install by package name

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

Create this extension with:

CREATE EXTENSION edtf_postgres;

Usage

Sources:

edtf_postgres 2.0.0 validates and normalizes Extended Date/Time Format expressions, calculates date bounds and compares temporal relations for ISO 8601-2:2019 Annex A.

Enable and Query

Release 2.0.0 supports PostgreSQL 15–19. The extension is trusted and relocatable: a role with database CREATE privilege can install it. No preload is required.

CREATE EXTENSION edtf_postgres;
SELECT edtf_valid('1985-04-12');
SELECT edtf_level('1985-04-12/..');
SELECT edtf_canonical('1985-04-12');
SELECT edtf_min('1985-04'), edtf_max('1985-04');
SELECT edtf_relation('1985', '1986');

The SQL interface operates on text and derived dates. It does not introduce a stored EDTF base type. Preserve the original input when qualifiers or uncertainty matter, and use derived bounds only for the intended query semantics.

Version 2.0 Boundaries

Version 1.3.5 is the final release with PostgreSQL 14 support. In 2.0.0, edtf_min and edtf_max return negative or positive infinity for bounds outside PostgreSQL’s finite date range, replacing the earlier NULL result. Bounds in years at or before zero are corrected. Review application predicates and any stored derived values when adopting the release.

Y-prefixed years with 19 or more digits are rejected. Normalization and interpretation of ambiguous ranges also change in this major release; revalidate representative historical inputs before replacing existing normalized output.

Table reader