tzf
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_tzf | 0.2.4 | GIS | MIT | Rust |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 1680 | tzf | No | Yes | No | Yes | No | No | - |
| Related | postgis geoip pg_cron postgis_topology postgis_raster postgis_sfcgal postgis_tiger_geocoder address_standardizer |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.2.4 | 1817161514 | pg_tzf | - |
| RPM | PIGSTY | 0.2.4 | 1817161514 | pg_tzf_$v | - |
| DEB | PIGSTY | 0.2.4 | 1817161514 | postgresql-$v-tzf | - |
Build
You can build the RPM / DEB packages for pg_tzf using pig build:
pig build pkg pg_tzf # build RPM / DEB packages
Install
You can install pg_tzf directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pg_tzf; # Install for current active PG version
pig ext install -y pg_tzf -v 18 # PG 18
pig ext install -y pg_tzf -v 17 # PG 17
pig ext install -y pg_tzf -v 16 # PG 16
pig ext install -y pg_tzf -v 15 # PG 15
pig ext install -y pg_tzf -v 14 # PG 14
dnf install -y pg_tzf_18 # PG 18
dnf install -y pg_tzf_17 # PG 17
dnf install -y pg_tzf_16 # PG 16
dnf install -y pg_tzf_15 # PG 15
dnf install -y pg_tzf_14 # PG 14
apt install -y postgresql-18-tzf # PG 18
apt install -y postgresql-17-tzf # PG 17
apt install -y postgresql-16-tzf # PG 16
apt install -y postgresql-15-tzf # PG 15
apt install -y postgresql-14-tzf # PG 14
Create Extension:
CREATE EXTENSION tzf;
Usage
tzf is a PostgreSQL extension for fast timezone lookup from longitude and latitude coordinates. The pgext catalog maps package pg_tzf to extension tzf and tracks version 0.2.4 for PostgreSQL 14-18.
Create the extension
CREATE EXTENSION tzf;
The upstream project packages one build artifact per PostgreSQL major version. Its release page now lists v0.3.0 after v0.2.4; this stub keeps the version and package names aligned with db/extension.csv.
Functions
Coordinate lookup:
SELECT tzf_tzname(116.3883, 39.9289) AS timezone;
Batch coordinate lookup:
SELECT unnest(
tzf_tzname_batch(
ARRAY[-74.0060, -118.2437, 139.6917],
ARRAY[40.7128, 34.0522, 35.6895]
)
) AS timezones;
Point lookup:
SELECT tzf_tzname_point(point(-74.0060, 40.7128)) AS timezone;
Batch point lookup:
SELECT unnest(
tzf_tzname_batch_points(
ARRAY[
point(-74.0060, 40.7128),
point(-118.2437, 34.0522),
point(139.6917, 35.6895)
]
)
) AS timezones;
Notes
- Upstream README documents support for PostgreSQL 14 through 18 builds.
- Pre-built release tarballs contain
tzf.so,tzf.control, andtzf--<version>.sql. - The current README still points to a complete schema in
sql/tzf.sqland includes benchmark figures for the four lookup functions above.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.