tzf

pg_tzf : Fast lookup timezone name by GPS coordinates

Overview

ID Extension Package Version Category License Language
1680
tzf
pg_tzf
0.2.3
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.3
18
17
16
15
14
pg_tzf -
RPM
PIGSTY
0.2.3
18
17
16
15
14
pg_tzf_$v -
DEB
PIGSTY
0.2.3
18
17
16
15
14
postgresql-$v-tzf -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
el8.aarch64
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
el9.x86_64
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
el9.aarch64
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
el10.x86_64
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
el10.aarch64
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
d12.x86_64
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
d12.aarch64
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
d13.x86_64
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
d13.aarch64
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
u22.x86_64
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
u22.aarch64
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
u24.x86_64
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
u24.aarch64
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
PIGSTY 0.2.3
Package Version OS ORG SIZE File URL
pg_tzf_18 0.2.3 el8.x86_64 pigsty 3.5 MiB pg_tzf_18-0.2.3-1PIGSTY.el8.x86_64.rpm
pg_tzf_18 0.2.3 el8.aarch64 pigsty 3.4 MiB pg_tzf_18-0.2.3-1PIGSTY.el8.aarch64.rpm
pg_tzf_18 0.2.3 el9.x86_64 pigsty 3.7 MiB pg_tzf_18-0.2.3-1PIGSTY.el9.x86_64.rpm
pg_tzf_18 0.2.3 el9.aarch64 pigsty 3.5 MiB pg_tzf_18-0.2.3-1PIGSTY.el9.aarch64.rpm
pg_tzf_18 0.2.3 el10.x86_64 pigsty 3.7 MiB pg_tzf_18-0.2.3-1PIGSTY.el10.x86_64.rpm
pg_tzf_18 0.2.3 el10.aarch64 pigsty 3.5 MiB pg_tzf_18-0.2.3-1PIGSTY.el10.aarch64.rpm
postgresql-18-tzf 0.2.3 d12.x86_64 pigsty 3.2 MiB postgresql-18-tzf_0.2.3-1PIGSTY~bookworm_amd64.deb
postgresql-18-tzf 0.2.3 d12.aarch64 pigsty 3.1 MiB postgresql-18-tzf_0.2.3-1PIGSTY~bookworm_arm64.deb
postgresql-18-tzf 0.2.3 d13.x86_64 pigsty 3.2 MiB postgresql-18-tzf_0.2.3-1PIGSTY~trixie_amd64.deb
postgresql-18-tzf 0.2.3 d13.aarch64 pigsty 3.1 MiB postgresql-18-tzf_0.2.3-1PIGSTY~trixie_arm64.deb
postgresql-18-tzf 0.2.3 u22.x86_64 pigsty 3.8 MiB postgresql-18-tzf_0.2.3-1PIGSTY~jammy_amd64.deb
postgresql-18-tzf 0.2.3 u22.aarch64 pigsty 4.0 MiB postgresql-18-tzf_0.2.3-1PIGSTY~jammy_arm64.deb
postgresql-18-tzf 0.2.3 u24.x86_64 pigsty 3.7 MiB postgresql-18-tzf_0.2.3-1PIGSTY~noble_amd64.deb
postgresql-18-tzf 0.2.3 u24.aarch64 pigsty 3.6 MiB postgresql-18-tzf_0.2.3-1PIGSTY~noble_arm64.deb
Package Version OS ORG SIZE File URL
pg_tzf_17 0.2.3 el8.x86_64 pigsty 3.5 MiB pg_tzf_17-0.2.3-1PIGSTY.el8.x86_64.rpm
pg_tzf_17 0.2.3 el8.aarch64 pigsty 3.4 MiB pg_tzf_17-0.2.3-1PIGSTY.el8.aarch64.rpm
pg_tzf_17 0.2.3 el9.x86_64 pigsty 3.6 MiB pg_tzf_17-0.2.3-1PIGSTY.el9.x86_64.rpm
pg_tzf_17 0.2.3 el9.aarch64 pigsty 3.5 MiB pg_tzf_17-0.2.3-1PIGSTY.el9.aarch64.rpm
pg_tzf_17 0.2.3 el10.x86_64 pigsty 3.7 MiB pg_tzf_17-0.2.3-1PIGSTY.el10.x86_64.rpm
pg_tzf_17 0.2.3 el10.aarch64 pigsty 3.5 MiB pg_tzf_17-0.2.3-1PIGSTY.el10.aarch64.rpm
postgresql-17-tzf 0.2.3 d12.x86_64 pigsty 3.2 MiB postgresql-17-tzf_0.2.3-1PIGSTY~bookworm_amd64.deb
postgresql-17-tzf 0.2.3 d12.aarch64 pigsty 3.1 MiB postgresql-17-tzf_0.2.3-1PIGSTY~bookworm_arm64.deb
postgresql-17-tzf 0.2.3 d13.x86_64 pigsty 3.2 MiB postgresql-17-tzf_0.2.3-1PIGSTY~trixie_amd64.deb
postgresql-17-tzf 0.2.3 d13.aarch64 pigsty 3.1 MiB postgresql-17-tzf_0.2.3-1PIGSTY~trixie_arm64.deb
postgresql-17-tzf 0.2.3 u22.x86_64 pigsty 3.8 MiB postgresql-17-tzf_0.2.3-1PIGSTY~jammy_amd64.deb
postgresql-17-tzf 0.2.3 u22.aarch64 pigsty 4.0 MiB postgresql-17-tzf_0.2.3-1PIGSTY~jammy_arm64.deb
postgresql-17-tzf 0.2.3 u24.x86_64 pigsty 3.7 MiB postgresql-17-tzf_0.2.3-1PIGSTY~noble_amd64.deb
postgresql-17-tzf 0.2.3 u24.aarch64 pigsty 3.6 MiB postgresql-17-tzf_0.2.3-1PIGSTY~noble_arm64.deb
Package Version OS ORG SIZE File URL
pg_tzf_16 0.2.3 el8.x86_64 pigsty 3.5 MiB pg_tzf_16-0.2.3-1PIGSTY.el8.x86_64.rpm
pg_tzf_16 0.2.3 el8.aarch64 pigsty 3.4 MiB pg_tzf_16-0.2.3-1PIGSTY.el8.aarch64.rpm
pg_tzf_16 0.2.3 el9.x86_64 pigsty 3.6 MiB pg_tzf_16-0.2.3-1PIGSTY.el9.x86_64.rpm
pg_tzf_16 0.2.3 el9.aarch64 pigsty 3.5 MiB pg_tzf_16-0.2.3-1PIGSTY.el9.aarch64.rpm
pg_tzf_16 0.2.3 el10.x86_64 pigsty 3.7 MiB pg_tzf_16-0.2.3-1PIGSTY.el10.x86_64.rpm
pg_tzf_16 0.2.3 el10.aarch64 pigsty 3.5 MiB pg_tzf_16-0.2.3-1PIGSTY.el10.aarch64.rpm
postgresql-16-tzf 0.2.3 d12.x86_64 pigsty 3.2 MiB postgresql-16-tzf_0.2.3-1PIGSTY~bookworm_amd64.deb
postgresql-16-tzf 0.2.3 d12.aarch64 pigsty 3.1 MiB postgresql-16-tzf_0.2.3-1PIGSTY~bookworm_arm64.deb
postgresql-16-tzf 0.2.3 d13.x86_64 pigsty 3.2 MiB postgresql-16-tzf_0.2.3-1PIGSTY~trixie_amd64.deb
postgresql-16-tzf 0.2.3 d13.aarch64 pigsty 3.1 MiB postgresql-16-tzf_0.2.3-1PIGSTY~trixie_arm64.deb
postgresql-16-tzf 0.2.3 u22.x86_64 pigsty 3.8 MiB postgresql-16-tzf_0.2.3-1PIGSTY~jammy_amd64.deb
postgresql-16-tzf 0.2.3 u22.aarch64 pigsty 4.0 MiB postgresql-16-tzf_0.2.3-1PIGSTY~jammy_arm64.deb
postgresql-16-tzf 0.2.3 u24.x86_64 pigsty 3.7 MiB postgresql-16-tzf_0.2.3-1PIGSTY~noble_amd64.deb
postgresql-16-tzf 0.2.3 u24.aarch64 pigsty 3.6 MiB postgresql-16-tzf_0.2.3-1PIGSTY~noble_arm64.deb
Package Version OS ORG SIZE File URL
pg_tzf_15 0.2.3 el8.x86_64 pigsty 3.5 MiB pg_tzf_15-0.2.3-1PIGSTY.el8.x86_64.rpm
pg_tzf_15 0.2.3 el8.aarch64 pigsty 3.4 MiB pg_tzf_15-0.2.3-1PIGSTY.el8.aarch64.rpm
pg_tzf_15 0.2.3 el9.x86_64 pigsty 3.7 MiB pg_tzf_15-0.2.3-1PIGSTY.el9.x86_64.rpm
pg_tzf_15 0.2.3 el9.aarch64 pigsty 3.5 MiB pg_tzf_15-0.2.3-1PIGSTY.el9.aarch64.rpm
pg_tzf_15 0.2.3 el10.x86_64 pigsty 3.7 MiB pg_tzf_15-0.2.3-1PIGSTY.el10.x86_64.rpm
pg_tzf_15 0.2.3 el10.aarch64 pigsty 3.5 MiB pg_tzf_15-0.2.3-1PIGSTY.el10.aarch64.rpm
postgresql-15-tzf 0.2.3 d12.x86_64 pigsty 3.2 MiB postgresql-15-tzf_0.2.3-1PIGSTY~bookworm_amd64.deb
postgresql-15-tzf 0.2.3 d12.aarch64 pigsty 3.2 MiB postgresql-15-tzf_0.2.3-1PIGSTY~bookworm_arm64.deb
postgresql-15-tzf 0.2.3 d13.x86_64 pigsty 3.2 MiB postgresql-15-tzf_0.2.3-1PIGSTY~trixie_amd64.deb
postgresql-15-tzf 0.2.3 d13.aarch64 pigsty 3.1 MiB postgresql-15-tzf_0.2.3-1PIGSTY~trixie_arm64.deb
postgresql-15-tzf 0.2.3 u22.x86_64 pigsty 3.9 MiB postgresql-15-tzf_0.2.3-1PIGSTY~jammy_amd64.deb
postgresql-15-tzf 0.2.3 u22.aarch64 pigsty 4.0 MiB postgresql-15-tzf_0.2.3-1PIGSTY~jammy_arm64.deb
postgresql-15-tzf 0.2.3 u24.x86_64 pigsty 3.7 MiB postgresql-15-tzf_0.2.3-1PIGSTY~noble_amd64.deb
postgresql-15-tzf 0.2.3 u24.aarch64 pigsty 3.6 MiB postgresql-15-tzf_0.2.3-1PIGSTY~noble_arm64.deb
Package Version OS ORG SIZE File URL
pg_tzf_14 0.2.3 el8.x86_64 pigsty 3.5 MiB pg_tzf_14-0.2.3-1PIGSTY.el8.x86_64.rpm
pg_tzf_14 0.2.3 el8.aarch64 pigsty 3.4 MiB pg_tzf_14-0.2.3-1PIGSTY.el8.aarch64.rpm
pg_tzf_14 0.2.3 el9.x86_64 pigsty 3.7 MiB pg_tzf_14-0.2.3-1PIGSTY.el9.x86_64.rpm
pg_tzf_14 0.2.3 el9.aarch64 pigsty 3.5 MiB pg_tzf_14-0.2.3-1PIGSTY.el9.aarch64.rpm
pg_tzf_14 0.2.3 el10.x86_64 pigsty 3.7 MiB pg_tzf_14-0.2.3-1PIGSTY.el10.x86_64.rpm
pg_tzf_14 0.2.3 el10.aarch64 pigsty 3.5 MiB pg_tzf_14-0.2.3-1PIGSTY.el10.aarch64.rpm
postgresql-14-tzf 0.2.3 d12.x86_64 pigsty 3.2 MiB postgresql-14-tzf_0.2.3-1PIGSTY~bookworm_amd64.deb
postgresql-14-tzf 0.2.3 d12.aarch64 pigsty 3.1 MiB postgresql-14-tzf_0.2.3-1PIGSTY~bookworm_arm64.deb
postgresql-14-tzf 0.2.3 d13.x86_64 pigsty 3.2 MiB postgresql-14-tzf_0.2.3-1PIGSTY~trixie_amd64.deb
postgresql-14-tzf 0.2.3 d13.aarch64 pigsty 3.1 MiB postgresql-14-tzf_0.2.3-1PIGSTY~trixie_arm64.deb
postgresql-14-tzf 0.2.3 u22.x86_64 pigsty 3.8 MiB postgresql-14-tzf_0.2.3-1PIGSTY~jammy_amd64.deb
postgresql-14-tzf 0.2.3 u22.aarch64 pigsty 4.0 MiB postgresql-14-tzf_0.2.3-1PIGSTY~jammy_arm64.deb
postgresql-14-tzf 0.2.3 u24.x86_64 pigsty 3.7 MiB postgresql-14-tzf_0.2.3-1PIGSTY~noble_amd64.deb
postgresql-14-tzf 0.2.3 u24.aarch64 pigsty 3.6 MiB postgresql-14-tzf_0.2.3-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

tzf: Fast timezone lookup for PostgreSQL

Find timezone names from coordinates. Built on tzf-rs with timezone boundary data from timezone-boundary-builder.

CREATE EXTENSION tzf;

Functions

Look up timezone for a coordinate (longitude, latitude):

SELECT tzf_tzname(116.3883, 39.9289) AS timezone;
-- Asia/Shanghai

Look up timezone for a batch of coordinates:

SELECT unnest(
  tzf_tzname_batch(
    ARRAY[-74.0060, -118.2437, 139.6917],
    ARRAY[40.7128, 34.0522, 35.6895]
  )
) AS timezones;
-- America/New_York
-- America/Los_Angeles
-- Asia/Tokyo

Look up timezone for a point:

SELECT tzf_tzname_point(point(-74.0060, 40.7128)) AS timezone;
-- America/New_York

Look up timezone for a batch of points:

SELECT unnest(
  tzf_tzname_batch_points(
    ARRAY[
      point(-74.0060, 40.7128),
      point(-118.2437, 34.0522),
      point(139.6917, 35.6895)
    ]
  )
) AS timezones;
-- America/New_York
-- America/Los_Angeles
-- Asia/Tokyo

Performance

Function TPS Note
tzf_tzname ~17,700 Single coordinate lookup
tzf_tzname_point ~17,600 Single point lookup
tzf_tzname_batch ~51 Batch of 1000 = ~51,000 TPS
tzf_tzname_batch_points ~32 Batch of 1000 = ~32,000 TPS
Last updated on