nominatim_fdw
nominatim_fdw : Nominatim Foreign Data Wrapper for PostgreSQL
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 8680 | nominatim_fdw
|
nominatim_fdw
|
2.0.0 |
FDW
|
MIT
|
C
|
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--s-d-r
|
No
|
Yes
|
No
|
Yes
|
yes
|
no
|
PIGSTY RPM and DEB packages are aligned at 2.0.0 for PostgreSQL 14 through 18.
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY
|
2.0.0 |
18
17
16
15
14
|
nominatim_fdw |
- |
| RPM | PIGSTY
|
2.0.0 |
18
17
16
15
14
|
nominatim_fdw_$v |
- |
| DEB | PIGSTY
|
2.0.0 |
18
17
16
15
14
|
postgresql-$v-nominatim-fdw |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
el8.x86_64
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
el8.aarch64
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
el9.x86_64
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
el9.aarch64
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
el10.x86_64
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
el10.aarch64
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
d12.x86_64
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
d12.aarch64
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
d13.x86_64
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
d13.aarch64
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
u22.x86_64
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
u22.aarch64
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
u24.x86_64
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
u24.aarch64
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
u26.x86_64
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
u26.aarch64
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
PIGSTY 2.0.0
|
Source
pig build pkg nominatim_fdw; # 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 nominatim_fdw; # install via package name, for the active PG version
pig install nominatim_fdw -v 18; # install for PG 18
pig install nominatim_fdw -v 17; # install for PG 17
pig install nominatim_fdw -v 16; # install for PG 16
pig install nominatim_fdw -v 15; # install for PG 15
pig install nominatim_fdw -v 14; # install for PG 14Create this extension with:
CREATE EXTENSION nominatim_fdw;Usage
Sources:
- nominatim_fdw v2.0 README
- nominatim_fdw v2.0 changelog
- Extension control file
- Official Nominatim API overview
- OpenStreetMap Nominatim usage policy
nominatim_fdw calls a Nominatim geocoding service from PostgreSQL. Unlike a conventional FDW, it exposes functions for search, reverse geocoding, and OSM-object lookup; it does not create queryable foreign tables.
Configure a Server
CREATE EXTENSION nominatim_fdw;
CREATE SERVER osm
FOREIGN DATA WRAPPER nominatim_fdw
OPTIONS (
url 'https://nominatim.openstreetmap.org',
connect_timeout '10',
max_connect_retry '2',
max_connect_redirect '1',
accept_language 'en'
);The public OpenStreetMap endpoint has an official usage policy. For sustained or bulk workloads, use an authorized provider or operate your own Nominatim service, identify the application as required, and respect rate limits.
Core Workflow
Free-form search:
SELECT osm_id, display_name, lon, lat
FROM nominatim_search(
server_name => 'osm',
q => 'Neubrückenstraße 63, Münster, Germany'
);Reverse geocoding and object lookup:
SELECT osm_id, display_name, addressdetails
FROM nominatim_reverse(
server_name => 'osm',
lon => 7.6293,
lat => 51.9648,
addressdetails => true
);
SELECT osm_id, display_name
FROM nominatim_lookup(
server_name => 'osm',
osm_ids => 'W121736959'
);Important Objects
nominatim_search(...)implements free-form or structured forward search.nominatim_reverse(...)resolves longitude and latitude to the nearest suitable OSM address.nominatim_lookup(...)fetches node, way, or relation identifiers such asN123,W456, orR789.nominatim_fdw_version()reports the extension and principal library versions.nominatim_fdw_settingsexposes dependency and build versions as rows.- Server options include
url, proxy configuration, timeouts, retry and redirect limits, and defaultaccept_language.
All endpoint functions are STRICT: an explicit SQL NULL argument returns no rows without sending a request. In 2.0 they are correctly declared VOLATILE, because responses are remote and can change.
Version 2.0 Changes and Caveats
Version 2.0 validates reverse coordinates, adds email, polygon_threshold, and entrances, exposes dependency settings, and fixes JSON escaping for returned detail fields. It also has user-visible compatibility changes: reverse output uses display_name; addressparts becomes addressdetails; address details default to true for reverse and lookup; and version output is shorter. Review result-column consumers before upgrading from 1.3.
Each call performs network I/O in the database statement. Use finite timeouts, constrain who can create or alter servers, and avoid invoking a public service once per row in a large query. The upstream build requires PostgreSQL 10 or newer, libxml2 2.5 or newer, and libcurl 7.74 or newer.