Skip to content

tzf

pg_tzf : Fast lookup timezone name by GPS coordinates

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
1680
tzf
pg_tzf
0.2.4
GIS
MIT
Rust
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--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

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
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 / PGPG18PG17PG16PG15PG14
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
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4

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

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, 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