跳转到主要内容

edtf_postgres

EDTF 日期校验、规范化、边界计算与时态关系

edtf_postgres · EDTF 日期校验、规范化、边界计算与时态关系

概览

ID扩展软件包版本类别许可证编程语言
1130edtf_postgresedtf_postgres2.0.0TIMEMITRust
属性可执行文件动态库需要预加载需要建扩展可迁移可信
--s-dtr否是否是是是

软件包

类型仓库版本兼容的 PostgreSQL 大版本包名模式依赖
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
软件包版本平台仓库大小下载
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
软件包版本平台仓库大小下载
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
软件包版本平台仓库大小下载
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
软件包版本平台仓库大小下载
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
软件包版本平台仓库大小下载
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

源码

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

pig build pkg edtf_postgres;		# build rpm/deb

安装

启用 PGDG 和 PIGSTY 仓库并更新缓存。

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

使用 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 EXTENSION edtf_postgres;

用法

来源:

edtf_postgres 2.0.0 按 ISO 8601-2:2019 Annex A 验证和规范化扩展日期时间表达式,计算日期边界并比较时间关系。

启用与查询

2.0.0 支持 PostgreSQL 15–19。扩展可信且可重定位,拥有数据库 CREATE 权限的角色即可安装,无需预加载。

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');

SQL 接口处理文本及派生日期,不引入存储型 EDTF 基础类型。限定符或不确定性重要时应保留原始输入,仅将派生边界用于相应查询语义。

2.0 版本边界

1.3.5 是最后支持 PostgreSQL 14 的版本。2.0.0 中,edtf_min 与 edtf_max 对超出 PostgreSQL 有限日期范围的边界返回负或正无穷,替代原先的 NULL;同时修正零年及更早年份的边界。采用新版本时应复核应用谓词与已经存储的派生值。

带 Y 前缀且达到 19 位或更多位数的年份会被拒绝。这个大版本也改变部分歧义范围的规范化与解释;替换已有规范化结果前,应使用代表性的历史输入重新验证。

表格阅读器