In geospatial applications, mapping coordinates to IANA time zones in real time is a common and performance-critical task.
Built on the pgrx framework and my previous Rust library tzf-rs, I developed and released tzf-pg, a PostgreSQL extension that enables microsecond-level lat/lon to time zone queries.

For installation instructions, please refer to the project README. Example usage:

1
2
3
4
5
6
7
8
9
tzf=# CREATE EXTENSION tzf;
CREATE EXTENSION
tzf=# SELECT tzf_tzname(116.3883, 39.9289);
tzf_tzname   
---------------
Asia/Shanghai
(1 row)

tzf=#

When randomly invoked using pgbench on a GitHub Actions runner, the single-node throughput peaked at 17,000 qps. Given the intense CPU contention on Actions runners, actual performance in a self-hosted environment would be even better—sufficient for most bulk import and high-concurrency real-time query scenarios.

Feel free to try it out, and submit issues or PRs to the repository to share feedback or feature requests!