跳转到主要内容

edtf_postgres

EDTF validation, normalization, date bounds, and temporal relations

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

Overview

ID Extension Package Version Category License Language
1130 edtf_postgres edtf_postgres 1.2.3 TIME MIT OR Apache-2.0 Rust
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-dtr No Yes No Yes yes yes
Relationships
See Also pg_when pgcalendar pg_rrule pg_duration
Trusted extension; upstream Cargo requests pgrx 0.19.1 and the locked build uses 0.19.2.

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT PIGSTY 1.2.3 18 17 16 15 14 edtf_postgres -
RPM PIGSTY 1.2.3 18 17 16 15 14 edtf_postgres_$v -
DEB PIGSTY 1.2.3 18 17 16 15 14 postgresql-$v-edtf-postgres -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3
el8.aarch64 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3
el9.x86_64 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3
el9.aarch64 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3
el10.x86_64 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3
el10.aarch64 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3
d12.x86_64 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3
d12.aarch64 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3
d13.x86_64 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3
d13.aarch64 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3
u22.x86_64 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3
u22.aarch64 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3
u24.x86_64 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3
u24.aarch64 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3
u26.x86_64 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3
u26.aarch64 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3 PIGSTY 1.2.3
Package Version OS ORG SIZE File URL
edtf_postgres_18 1.2.3 el8.x86_64 pigsty 1.5 MiB edtf_postgres_18-1.2.3-1PGSTY.el8.x86_64.rpm
edtf_postgres_18 1.2.3 el8.aarch64 pigsty 1.5 MiB edtf_postgres_18-1.2.3-1PGSTY.el8.aarch64.rpm
edtf_postgres_18 1.2.3 el9.x86_64 pigsty 1.6 MiB edtf_postgres_18-1.2.3-1PGSTY.el9.x86_64.rpm
edtf_postgres_18 1.2.3 el9.aarch64 pigsty 1.6 MiB edtf_postgres_18-1.2.3-1PGSTY.el9.aarch64.rpm
edtf_postgres_18 1.2.3 el10.x86_64 pigsty 1.6 MiB edtf_postgres_18-1.2.3-1PGSTY.el10.x86_64.rpm
edtf_postgres_18 1.2.3 el10.aarch64 pigsty 1.6 MiB edtf_postgres_18-1.2.3-1PGSTY.el10.aarch64.rpm
postgresql-18-edtf-postgres 1.2.3 d12.x86_64 pigsty 1.2 MiB postgresql-18-edtf-postgres_1.2.3-1PGSTY~bookworm_amd64.deb
postgresql-18-edtf-postgres 1.2.3 d12.aarch64 pigsty 1.1 MiB postgresql-18-edtf-postgres_1.2.3-1PGSTY~bookworm_arm64.deb
postgresql-18-edtf-postgres 1.2.3 d13.x86_64 pigsty 1.2 MiB postgresql-18-edtf-postgres_1.2.3-1PGSTY~trixie_amd64.deb
postgresql-18-edtf-postgres 1.2.3 d13.aarch64 pigsty 1.1 MiB postgresql-18-edtf-postgres_1.2.3-1PGSTY~trixie_arm64.deb
postgresql-18-edtf-postgres 1.2.3 u22.x86_64 pigsty 1.3 MiB postgresql-18-edtf-postgres_1.2.3-1PGSTY~jammy_amd64.deb
postgresql-18-edtf-postgres 1.2.3 u22.aarch64 pigsty 1.3 MiB postgresql-18-edtf-postgres_1.2.3-1PGSTY~jammy_arm64.deb
postgresql-18-edtf-postgres 1.2.3 u24.x86_64 pigsty 1.3 MiB postgresql-18-edtf-postgres_1.2.3-1PGSTY~noble_amd64.deb
postgresql-18-edtf-postgres 1.2.3 u24.aarch64 pigsty 1.3 MiB postgresql-18-edtf-postgres_1.2.3-1PGSTY~noble_arm64.deb
postgresql-18-edtf-postgres 1.2.3 u26.x86_64 pigsty 1.3 MiB postgresql-18-edtf-postgres_1.2.3-1PGSTY~resolute_amd64.deb
postgresql-18-edtf-postgres 1.2.3 u26.aarch64 pigsty 1.3 MiB postgresql-18-edtf-postgres_1.2.3-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
edtf_postgres_17 1.2.3 el8.x86_64 pigsty 1.5 MiB edtf_postgres_17-1.2.3-1PGSTY.el8.x86_64.rpm
edtf_postgres_17 1.2.3 el8.aarch64 pigsty 1.5 MiB edtf_postgres_17-1.2.3-1PGSTY.el8.aarch64.rpm
edtf_postgres_17 1.2.3 el9.x86_64 pigsty 1.5 MiB edtf_postgres_17-1.2.3-1PGSTY.el9.x86_64.rpm
edtf_postgres_17 1.2.3 el9.aarch64 pigsty 1.6 MiB edtf_postgres_17-1.2.3-1PGSTY.el9.aarch64.rpm
edtf_postgres_17 1.2.3 el10.x86_64 pigsty 1.5 MiB edtf_postgres_17-1.2.3-1PGSTY.el10.x86_64.rpm
edtf_postgres_17 1.2.3 el10.aarch64 pigsty 1.6 MiB edtf_postgres_17-1.2.3-1PGSTY.el10.aarch64.rpm
postgresql-17-edtf-postgres 1.2.3 d12.x86_64 pigsty 1.2 MiB postgresql-17-edtf-postgres_1.2.3-1PGSTY~bookworm_amd64.deb
postgresql-17-edtf-postgres 1.2.3 d12.aarch64 pigsty 1.1 MiB postgresql-17-edtf-postgres_1.2.3-1PGSTY~bookworm_arm64.deb
postgresql-17-edtf-postgres 1.2.3 d13.x86_64 pigsty 1.2 MiB postgresql-17-edtf-postgres_1.2.3-1PGSTY~trixie_amd64.deb
postgresql-17-edtf-postgres 1.2.3 d13.aarch64 pigsty 1.1 MiB postgresql-17-edtf-postgres_1.2.3-1PGSTY~trixie_arm64.deb
postgresql-17-edtf-postgres 1.2.3 u22.x86_64 pigsty 1.3 MiB postgresql-17-edtf-postgres_1.2.3-1PGSTY~jammy_amd64.deb
postgresql-17-edtf-postgres 1.2.3 u22.aarch64 pigsty 1.3 MiB postgresql-17-edtf-postgres_1.2.3-1PGSTY~jammy_arm64.deb
postgresql-17-edtf-postgres 1.2.3 u24.x86_64 pigsty 1.3 MiB postgresql-17-edtf-postgres_1.2.3-1PGSTY~noble_amd64.deb
postgresql-17-edtf-postgres 1.2.3 u24.aarch64 pigsty 1.3 MiB postgresql-17-edtf-postgres_1.2.3-1PGSTY~noble_arm64.deb
postgresql-17-edtf-postgres 1.2.3 u26.x86_64 pigsty 1.3 MiB postgresql-17-edtf-postgres_1.2.3-1PGSTY~resolute_amd64.deb
postgresql-17-edtf-postgres 1.2.3 u26.aarch64 pigsty 1.3 MiB postgresql-17-edtf-postgres_1.2.3-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
edtf_postgres_16 1.2.3 el8.x86_64 pigsty 1.5 MiB edtf_postgres_16-1.2.3-1PGSTY.el8.x86_64.rpm
edtf_postgres_16 1.2.3 el8.aarch64 pigsty 1.5 MiB edtf_postgres_16-1.2.3-1PGSTY.el8.aarch64.rpm
edtf_postgres_16 1.2.3 el9.x86_64 pigsty 1.5 MiB edtf_postgres_16-1.2.3-1PGSTY.el9.x86_64.rpm
edtf_postgres_16 1.2.3 el9.aarch64 pigsty 1.6 MiB edtf_postgres_16-1.2.3-1PGSTY.el9.aarch64.rpm
edtf_postgres_16 1.2.3 el10.x86_64 pigsty 1.5 MiB edtf_postgres_16-1.2.3-1PGSTY.el10.x86_64.rpm
edtf_postgres_16 1.2.3 el10.aarch64 pigsty 1.6 MiB edtf_postgres_16-1.2.3-1PGSTY.el10.aarch64.rpm
postgresql-16-edtf-postgres 1.2.3 d12.x86_64 pigsty 1.2 MiB postgresql-16-edtf-postgres_1.2.3-1PGSTY~bookworm_amd64.deb
postgresql-16-edtf-postgres 1.2.3 d12.aarch64 pigsty 1.1 MiB postgresql-16-edtf-postgres_1.2.3-1PGSTY~bookworm_arm64.deb
postgresql-16-edtf-postgres 1.2.3 d13.x86_64 pigsty 1.2 MiB postgresql-16-edtf-postgres_1.2.3-1PGSTY~trixie_amd64.deb
postgresql-16-edtf-postgres 1.2.3 d13.aarch64 pigsty 1.1 MiB postgresql-16-edtf-postgres_1.2.3-1PGSTY~trixie_arm64.deb
postgresql-16-edtf-postgres 1.2.3 u22.x86_64 pigsty 1.3 MiB postgresql-16-edtf-postgres_1.2.3-1PGSTY~jammy_amd64.deb
postgresql-16-edtf-postgres 1.2.3 u22.aarch64 pigsty 1.3 MiB postgresql-16-edtf-postgres_1.2.3-1PGSTY~jammy_arm64.deb
postgresql-16-edtf-postgres 1.2.3 u24.x86_64 pigsty 1.3 MiB postgresql-16-edtf-postgres_1.2.3-1PGSTY~noble_amd64.deb
postgresql-16-edtf-postgres 1.2.3 u24.aarch64 pigsty 1.3 MiB postgresql-16-edtf-postgres_1.2.3-1PGSTY~noble_arm64.deb
postgresql-16-edtf-postgres 1.2.3 u26.x86_64 pigsty 1.3 MiB postgresql-16-edtf-postgres_1.2.3-1PGSTY~resolute_amd64.deb
postgresql-16-edtf-postgres 1.2.3 u26.aarch64 pigsty 1.3 MiB postgresql-16-edtf-postgres_1.2.3-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
edtf_postgres_15 1.2.3 el8.x86_64 pigsty 1.5 MiB edtf_postgres_15-1.2.3-1PGSTY.el8.x86_64.rpm
edtf_postgres_15 1.2.3 el8.aarch64 pigsty 1.5 MiB edtf_postgres_15-1.2.3-1PGSTY.el8.aarch64.rpm
edtf_postgres_15 1.2.3 el9.x86_64 pigsty 1.5 MiB edtf_postgres_15-1.2.3-1PGSTY.el9.x86_64.rpm
edtf_postgres_15 1.2.3 el9.aarch64 pigsty 1.6 MiB edtf_postgres_15-1.2.3-1PGSTY.el9.aarch64.rpm
edtf_postgres_15 1.2.3 el10.x86_64 pigsty 1.5 MiB edtf_postgres_15-1.2.3-1PGSTY.el10.x86_64.rpm
edtf_postgres_15 1.2.3 el10.aarch64 pigsty 1.6 MiB edtf_postgres_15-1.2.3-1PGSTY.el10.aarch64.rpm
postgresql-15-edtf-postgres 1.2.3 d12.x86_64 pigsty 1.2 MiB postgresql-15-edtf-postgres_1.2.3-1PGSTY~bookworm_amd64.deb
postgresql-15-edtf-postgres 1.2.3 d12.aarch64 pigsty 1.1 MiB postgresql-15-edtf-postgres_1.2.3-1PGSTY~bookworm_arm64.deb
postgresql-15-edtf-postgres 1.2.3 d13.x86_64 pigsty 1.2 MiB postgresql-15-edtf-postgres_1.2.3-1PGSTY~trixie_amd64.deb
postgresql-15-edtf-postgres 1.2.3 d13.aarch64 pigsty 1.1 MiB postgresql-15-edtf-postgres_1.2.3-1PGSTY~trixie_arm64.deb
postgresql-15-edtf-postgres 1.2.3 u22.x86_64 pigsty 1.3 MiB postgresql-15-edtf-postgres_1.2.3-1PGSTY~jammy_amd64.deb
postgresql-15-edtf-postgres 1.2.3 u22.aarch64 pigsty 1.3 MiB postgresql-15-edtf-postgres_1.2.3-1PGSTY~jammy_arm64.deb
postgresql-15-edtf-postgres 1.2.3 u24.x86_64 pigsty 1.3 MiB postgresql-15-edtf-postgres_1.2.3-1PGSTY~noble_amd64.deb
postgresql-15-edtf-postgres 1.2.3 u24.aarch64 pigsty 1.3 MiB postgresql-15-edtf-postgres_1.2.3-1PGSTY~noble_arm64.deb
postgresql-15-edtf-postgres 1.2.3 u26.x86_64 pigsty 1.3 MiB postgresql-15-edtf-postgres_1.2.3-1PGSTY~resolute_amd64.deb
postgresql-15-edtf-postgres 1.2.3 u26.aarch64 pigsty 1.3 MiB postgresql-15-edtf-postgres_1.2.3-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
edtf_postgres_14 1.2.3 el8.x86_64 pigsty 1.5 MiB edtf_postgres_14-1.2.3-1PGSTY.el8.x86_64.rpm
edtf_postgres_14 1.2.3 el8.aarch64 pigsty 1.5 MiB edtf_postgres_14-1.2.3-1PGSTY.el8.aarch64.rpm
edtf_postgres_14 1.2.3 el9.x86_64 pigsty 1.5 MiB edtf_postgres_14-1.2.3-1PGSTY.el9.x86_64.rpm
edtf_postgres_14 1.2.3 el9.aarch64 pigsty 1.6 MiB edtf_postgres_14-1.2.3-1PGSTY.el9.aarch64.rpm
edtf_postgres_14 1.2.3 el10.x86_64 pigsty 1.5 MiB edtf_postgres_14-1.2.3-1PGSTY.el10.x86_64.rpm
edtf_postgres_14 1.2.3 el10.aarch64 pigsty 1.6 MiB edtf_postgres_14-1.2.3-1PGSTY.el10.aarch64.rpm
postgresql-14-edtf-postgres 1.2.3 d12.x86_64 pigsty 1.2 MiB postgresql-14-edtf-postgres_1.2.3-1PGSTY~bookworm_amd64.deb
postgresql-14-edtf-postgres 1.2.3 d12.aarch64 pigsty 1.1 MiB postgresql-14-edtf-postgres_1.2.3-1PGSTY~bookworm_arm64.deb
postgresql-14-edtf-postgres 1.2.3 d13.x86_64 pigsty 1.2 MiB postgresql-14-edtf-postgres_1.2.3-1PGSTY~trixie_amd64.deb
postgresql-14-edtf-postgres 1.2.3 d13.aarch64 pigsty 1.1 MiB postgresql-14-edtf-postgres_1.2.3-1PGSTY~trixie_arm64.deb
postgresql-14-edtf-postgres 1.2.3 u22.x86_64 pigsty 1.3 MiB postgresql-14-edtf-postgres_1.2.3-1PGSTY~jammy_amd64.deb
postgresql-14-edtf-postgres 1.2.3 u22.aarch64 pigsty 1.3 MiB postgresql-14-edtf-postgres_1.2.3-1PGSTY~jammy_arm64.deb
postgresql-14-edtf-postgres 1.2.3 u24.x86_64 pigsty 1.3 MiB postgresql-14-edtf-postgres_1.2.3-1PGSTY~noble_amd64.deb
postgresql-14-edtf-postgres 1.2.3 u24.aarch64 pigsty 1.3 MiB postgresql-14-edtf-postgres_1.2.3-1PGSTY~noble_arm64.deb
postgresql-14-edtf-postgres 1.2.3 u26.x86_64 pigsty 1.3 MiB postgresql-14-edtf-postgres_1.2.3-1PGSTY~resolute_amd64.deb
postgresql-14-edtf-postgres 1.2.3 u26.aarch64 pigsty 1.3 MiB postgresql-14-edtf-postgres_1.2.3-1PGSTY~resolute_arm64.deb

Source

github.com/monumental-archive/edtf/tree/edtf-postgres-v1.2.3/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 via package name, for the active PG version

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
pig install edtf_postgres -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION edtf_postgres;

Usage

Sources:

edtf_postgres exposes Extended Date/Time Format validation, normalization, bounds, and temporal relations for ISO 8601-2:2019 Annex A strings.

Enablement

Release 1.2.3 publishes artifacts for PostgreSQL 14–18 on amd64 and arm64. Install the matching artifact, then run:

CREATE EXTENSION edtf_postgres;

The extension is relocatable and trusted, so a role with database CREATE privilege can install it. It does not require preloading.

Validation and Canonical Form

Use edtf_valid before accepting external text, edtf_level to inspect the supported EDTF level, and edtf_canonical to normalize equivalent forms.

SELECT edtf_valid('1985-04-12');
SELECT edtf_level('1985-04-12/..');
SELECT edtf_canonical('1985-04-12');

edtf_min and edtf_max return index-friendly date bounds. edtf_relation compares two expressions and returns a three-valued temporal relation.

SELECT edtf_min('1985-04'), edtf_max('1985-04');
SELECT edtf_relation('1985', '1986');

Data Modeling Boundary

The extension operates on text and derived dates; it does not replace application validation or introduce a stored EDTF base type. Preserve the original expression when uncertainty and qualifiers are significant, and index derived bounds only for the query semantics your application intends.