Skip to content

tzf

pg_tzf : Fast lookup timezone name by GPS coordinates

Overview

ID Extension Package Version Category License Language
1680
tzf
pg_tzf
0.2.4
GIS
MIT
Rust
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-d--
No
Yes
No
Yes
no
no
Relationships
See Also
postgis
geoip
pg_cron
postgis_topology
postgis_raster
postgis_sfcgal
postgis_tiger_geocoder
address_standardizer

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
PIGSTY
0.2.4
18
17
16
15
14
pg_tzf -
RPM
PIGSTY
0.2.4
18
17
16
15
14
pg_tzf_$v -
DEB
PIGSTY
0.2.4
18
17
16
15
14
postgresql-$v-tzf -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
el8.aarch64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
el9.x86_64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
el9.aarch64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
el10.x86_64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
el10.aarch64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
d12.x86_64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
d12.aarch64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
d13.x86_64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
d13.aarch64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
u22.x86_64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
u22.aarch64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
u24.x86_64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
u24.aarch64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
u26.x86_64
MISS
MISS
MISS
MISS
MISS
u26.aarch64
MISS
MISS
MISS
MISS
MISS
Package Version OS ORG SIZE File URL
pg_tzf_18 0.2.4 el8.x86_64 pigsty 3.6 MiB pg_tzf_18-0.2.4-1PIGSTY.el8.x86_64.rpm
pg_tzf_18 0.2.4 el8.aarch64 pigsty 3.5 MiB pg_tzf_18-0.2.4-1PIGSTY.el8.aarch64.rpm
pg_tzf_18 0.2.4 el9.x86_64 pigsty 3.7 MiB pg_tzf_18-0.2.4-1PIGSTY.el9.x86_64.rpm
pg_tzf_18 0.2.4 el9.aarch64 pigsty 3.6 MiB pg_tzf_18-0.2.4-1PIGSTY.el9.aarch64.rpm
pg_tzf_18 0.2.4 el10.x86_64 pigsty 3.7 MiB pg_tzf_18-0.2.4-1PIGSTY.el10.x86_64.rpm
pg_tzf_18 0.2.4 el10.aarch64 pigsty 3.5 MiB pg_tzf_18-0.2.4-1PIGSTY.el10.aarch64.rpm
postgresql-18-tzf 0.2.4 d12.x86_64 pigsty 3.2 MiB postgresql-18-tzf_0.2.4-1PIGSTY~bookworm_amd64.deb
postgresql-18-tzf 0.2.4 d12.aarch64 pigsty 3.1 MiB postgresql-18-tzf_0.2.4-1PIGSTY~bookworm_arm64.deb
postgresql-18-tzf 0.2.4 d13.x86_64 pigsty 3.2 MiB postgresql-18-tzf_0.2.4-1PIGSTY~trixie_amd64.deb
postgresql-18-tzf 0.2.4 d13.aarch64 pigsty 3.1 MiB postgresql-18-tzf_0.2.4-1PIGSTY~trixie_arm64.deb
postgresql-18-tzf 0.2.4 u22.x86_64 pigsty 3.7 MiB postgresql-18-tzf_0.2.4-1PIGSTY~jammy_amd64.deb
postgresql-18-tzf 0.2.4 u22.aarch64 pigsty 3.7 MiB postgresql-18-tzf_0.2.4-1PIGSTY~jammy_arm64.deb
postgresql-18-tzf 0.2.4 u24.x86_64 pigsty 3.6 MiB postgresql-18-tzf_0.2.4-1PIGSTY~noble_amd64.deb
postgresql-18-tzf 0.2.4 u24.aarch64 pigsty 3.5 MiB postgresql-18-tzf_0.2.4-1PIGSTY~noble_arm64.deb

Source

pig build pkg pg_tzf;		# 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 pg_tzf;		# install via package name, for the active PG version
pig install tzf;		# install by extension name, for the current active PG version

pig install tzf -v 18;   # install for PG 18
pig install tzf -v 17;   # install for PG 17
pig install tzf -v 16;   # install for PG 16
pig install tzf -v 15;   # install for PG 15
pig install tzf -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION tzf;

Usage

Sources: README, releases, Cargo.toml

tzf is a PostgreSQL extension for fast timezone lookup from longitude and latitude coordinates.

Create the extension

CREATE EXTENSION tzf;

The upstream project packages one build artifact per PostgreSQL major version. Current source metadata says extension version 0.2.4.

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, and tzf--<version>.sql.
  • The current README still points to a complete schema in sql/tzf.sql and includes benchmark figures for the four lookup functions above.
Last updated on