pg_duration
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_duration | 1.0.2 | TYPE | MIT | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 3850 | pg_duration | No | Yes | No | Yes | No | Yes | - |
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0.2 | 1817161514 | pg_duration | - |
| RPM | PIGSTY | 1.0.2 | 1817161514 | pg_duration_$v | - |
| DEB | PIGSTY | 1.0.2 | 1817161514 | postgresql-$v-pg-duration | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.0.2 el8.x86_64.pg18 : pg_duration_18 pg_duration_18-1.0.2-1PIGSTY.el8.x86_64.rpm
| PIGSTY 1.0.2 el8.x86_64.pg17 : pg_duration_17 pg_duration_17-1.0.2-1PIGSTY.el8.x86_64.rpm
| N/A | N/A | N/A |
| el8.aarch64 | PIGSTY 1.0.2 el8.aarch64.pg18 : pg_duration_18 pg_duration_18-1.0.2-1PIGSTY.el8.aarch64.rpm
| PIGSTY 1.0.2 el8.aarch64.pg17 : pg_duration_17 pg_duration_17-1.0.2-1PIGSTY.el8.aarch64.rpm
| N/A | N/A | N/A |
| el9.x86_64 | PIGSTY 1.0.2 el9.x86_64.pg18 : pg_duration_18 pg_duration_18-1.0.2-1PIGSTY.el9.x86_64.rpm
| PIGSTY 1.0.2 el9.x86_64.pg17 : pg_duration_17 pg_duration_17-1.0.2-1PIGSTY.el9.x86_64.rpm
| N/A | N/A | N/A |
| el9.aarch64 | PIGSTY 1.0.2 el9.aarch64.pg18 : pg_duration_18 pg_duration_18-1.0.2-1PIGSTY.el9.aarch64.rpm
| PIGSTY 1.0.2 el9.aarch64.pg17 : pg_duration_17 pg_duration_17-1.0.2-1PIGSTY.el9.aarch64.rpm
| N/A | N/A | N/A |
| el10.x86_64 | PIGSTY 1.0.2 el10.x86_64.pg18 : pg_duration_18 pg_duration_18-1.0.2-1PIGSTY.el10.x86_64.rpm
| PIGSTY 1.0.2 el10.x86_64.pg17 : pg_duration_17 pg_duration_17-1.0.2-1PIGSTY.el10.x86_64.rpm
| N/A | N/A | N/A |
| el10.aarch64 | PIGSTY 1.0.2 el10.aarch64.pg18 : pg_duration_18 pg_duration_18-1.0.2-1PIGSTY.el10.aarch64.rpm
| PIGSTY 1.0.2 el10.aarch64.pg17 : pg_duration_17 pg_duration_17-1.0.2-1PIGSTY.el10.aarch64.rpm
| N/A | N/A | N/A |
| d12.x86_64 | PIGSTY 1.0.2 d12.x86_64.pg18 : postgresql-18-pg-duration postgresql-18-pg-duration_1.0.2-1PIGSTY~bookworm_amd64.deb
| PIGSTY 1.0.2 d12.x86_64.pg17 : postgresql-17-pg-duration postgresql-17-pg-duration_1.0.2-1PIGSTY~bookworm_amd64.deb
| N/A | N/A | N/A |
| d12.aarch64 | PIGSTY 1.0.2 d12.aarch64.pg18 : postgresql-18-pg-duration postgresql-18-pg-duration_1.0.2-1PIGSTY~bookworm_arm64.deb
| PIGSTY 1.0.2 d12.aarch64.pg17 : postgresql-17-pg-duration postgresql-17-pg-duration_1.0.2-1PIGSTY~bookworm_arm64.deb
| N/A | N/A | N/A |
| d13.x86_64 | PIGSTY 1.0.2 d13.x86_64.pg18 : postgresql-18-pg-duration postgresql-18-pg-duration_1.0.2-1PIGSTY~trixie_amd64.deb
| PIGSTY 1.0.2 d13.x86_64.pg17 : postgresql-17-pg-duration postgresql-17-pg-duration_1.0.2-1PIGSTY~trixie_amd64.deb
| N/A | N/A | N/A |
| d13.aarch64 | PIGSTY 1.0.2 d13.aarch64.pg18 : postgresql-18-pg-duration postgresql-18-pg-duration_1.0.2-1PIGSTY~trixie_arm64.deb
| PIGSTY 1.0.2 d13.aarch64.pg17 : postgresql-17-pg-duration postgresql-17-pg-duration_1.0.2-1PIGSTY~trixie_arm64.deb
| N/A | N/A | N/A |
| u22.x86_64 | PIGSTY 1.0.2 u22.x86_64.pg18 : postgresql-18-pg-duration postgresql-18-pg-duration_1.0.2-1PIGSTY~jammy_amd64.deb
| PIGSTY 1.0.2 u22.x86_64.pg17 : postgresql-17-pg-duration postgresql-17-pg-duration_1.0.2-1PIGSTY~jammy_amd64.deb
| N/A | N/A | N/A |
| u22.aarch64 | PIGSTY 1.0.2 u22.aarch64.pg18 : postgresql-18-pg-duration postgresql-18-pg-duration_1.0.2-1PIGSTY~jammy_arm64.deb
| PIGSTY 1.0.2 u22.aarch64.pg17 : postgresql-17-pg-duration postgresql-17-pg-duration_1.0.2-1PIGSTY~jammy_arm64.deb
| N/A | N/A | N/A |
| u24.x86_64 | PIGSTY 1.0.2 u24.x86_64.pg18 : postgresql-18-pg-duration postgresql-18-pg-duration_1.0.2-1PIGSTY~noble_amd64.deb
| PIGSTY 1.0.2 u24.x86_64.pg17 : postgresql-17-pg-duration postgresql-17-pg-duration_1.0.2-1PIGSTY~noble_amd64.deb
| N/A | N/A | N/A |
| u24.aarch64 | PIGSTY 1.0.2 u24.aarch64.pg18 : postgresql-18-pg-duration postgresql-18-pg-duration_1.0.2-1PIGSTY~noble_arm64.deb
| PIGSTY 1.0.2 u24.aarch64.pg17 : postgresql-17-pg-duration postgresql-17-pg-duration_1.0.2-1PIGSTY~noble_arm64.deb
| N/A | N/A | N/A |
| u26.x86_64 | PIGSTY 1.0.2 u26.x86_64.pg18 : postgresql-18-pg-duration postgresql-18-pg-duration_1.0.2-1PIGSTY~resolute_amd64.deb
| PIGSTY 1.0.2 u26.x86_64.pg17 : postgresql-17-pg-duration postgresql-17-pg-duration_1.0.2-1PIGSTY~resolute_amd64.deb
| N/A | N/A | N/A |
| u26.aarch64 | PIGSTY 1.0.2 u26.aarch64.pg18 : postgresql-18-pg-duration postgresql-18-pg-duration_1.0.2-1PIGSTY~resolute_arm64.deb
| PIGSTY 1.0.2 u26.aarch64.pg17 : postgresql-17-pg-duration postgresql-17-pg-duration_1.0.2-1PIGSTY~resolute_arm64.deb
| N/A | N/A | N/A |
Build
You can build the RPM / DEB packages for pg_duration using pig build:
Install
You can install pg_duration directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
The pg_duration extension provides a duration type for storing elapsed time as microseconds in 8 bytes, simpler and more consistently comparable than the built-in interval type.
Data Type
The duration type represents absolute elapsed time without calendar components (no months or days). Valid input accepts any PostgreSQL interval syntax that does not exceed hourly units.
Operators
- Arithmetic:
+,-between durations;*,/byfloat8; unary- - Comparison:
<,<=,>,>=,=,<>
Functions
Type Conversions
Durations cast implicitly to interval. Converting interval to duration requires explicit casting.
Aggregates and Indexing
Standard aggregates (avg, count, max, min, sum) and both B-tree and hash indexes are supported.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)