tzf
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 |
Source
pig build pkg pg_tzf; # build rpm/debInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgsql -u # add both repo and update cacheInstall 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 14Create this extension with:
CREATE EXTENSION tzf;Usage
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/ShanghaiLook 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/TokyoLook up timezone for a point:
SELECT tzf_tzname_point(point(-74.0060, 40.7128)) AS timezone;
-- America/New_YorkLook 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/TokyoPerformance
| 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