pg_duration
pg_duration : data type for representing durations
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 3850 | pg_duration | pg_duration | 1.0.2 |
TYPE | MIT | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | pgcalendar pg_rrule pg_bikram_sambat timestamp9 pg_when cron_utils pg_cron |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0.2 |
18 17 16 15 14 | pg_duration |
- |
| RPM | PIGSTY | 1.0.2 |
18 17 16 15 14 | pg_duration_$v |
- |
| DEB | PIGSTY | 1.0.2 |
18 17 16 15 14 | postgresql-$v-pg-duration |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | N/A | N/A | N/A |
| el8.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | N/A | N/A | N/A |
| el9.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | N/A | N/A | N/A |
| el9.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | N/A | N/A | N/A |
| el10.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | N/A | N/A | N/A |
| el10.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | N/A | N/A | N/A |
| d12.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | N/A | N/A | N/A |
| d12.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | N/A | N/A | N/A |
| d13.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | N/A | N/A | N/A |
| d13.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | N/A | N/A | N/A |
| u22.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | N/A | N/A | N/A |
| u22.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | N/A | N/A | N/A |
| u24.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | N/A | N/A | N/A |
| u24.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | N/A | N/A | N/A |
| u26.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | N/A | N/A | N/A |
| u26.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | N/A | N/A | N/A |
Source
github.com/jkosh44/pg_duration
pg_duration-1.0.2.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
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.