nominatim_fdw

Nominatim Foreign Data Wrapper for PostgreSQL

Overview

PackageVersionCategoryLicenseLanguage
nominatim_fdw1.3FDWMITC
IDExtensionBinLibLoadCreateTrustRelocSchema
8680nominatim_fdwNoYesNoYesNoYes-

Version

TypeRepoVersionPG VerPackageDeps
EXTPGDG1.31817161514nominatim_fdw-
RPMPGDG1.31817161514nominatim_fdw_$v-
DEBPIGSTY1.21817161514postgresql-$v-nominatim-fdw-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
d12.aarch64
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
d13.x86_64
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
d13.aarch64
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
u22.x86_64
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
u22.aarch64
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
u24.x86_64
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
u24.aarch64
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2
PIGSTY 1.2

Build

You can build the RPM / DEB packages for nominatim_fdw using pig build:

pig build pkg nominatim_fdw         # build RPM / DEB packages

Install

You can install nominatim_fdw directly. First, make sure the PGDG repository is added and enabled:

pig repo add pgdg -u          # Add PGDG repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install nominatim_fdw;          # Install for current active PG version
pig ext install -y nominatim_fdw -v 18  # PG 18
pig ext install -y nominatim_fdw -v 17  # PG 17
pig ext install -y nominatim_fdw -v 16  # PG 16
pig ext install -y nominatim_fdw -v 15  # PG 15
pig ext install -y nominatim_fdw -v 14  # PG 14
dnf install -y nominatim_fdw_18       # PG 18
dnf install -y nominatim_fdw_17       # PG 17
dnf install -y nominatim_fdw_16       # PG 16
dnf install -y nominatim_fdw_15       # PG 15
dnf install -y nominatim_fdw_14       # PG 14
apt install -y postgresql-18-nominatim-fdw   # PG 18
apt install -y postgresql-17-nominatim-fdw   # PG 17
apt install -y postgresql-16-nominatim-fdw   # PG 16
apt install -y postgresql-15-nominatim-fdw   # PG 15
apt install -y postgresql-14-nominatim-fdw   # PG 14

Create Extension:

CREATE EXTENSION nominatim_fdw;

Usage

Sources: README, Nominatim API

nominatim_fdw is a PostgreSQL foreign data wrapper for Nominatim geocoding services. Upstream exposes it through SQL functions mapped to the Nominatim search, reverse, and lookup endpoints rather than through foreign tables.

Create a server

CREATE EXTENSION nominatim_fdw;

CREATE SERVER osm
FOREIGN DATA WRAPPER nominatim_fdw
OPTIONS (url 'https://nominatim.openstreetmap.org');

Documented server options:

  • url (required)
  • http_proxy
  • connect_timeout
  • max_connect_retry
  • max_connect_redirect

Proxy credentials belong in a user mapping:

CREATE USER MAPPING FOR pguser
SERVER osm
OPTIONS (proxy_user 'myuser', proxy_password 'mysecret');

Geocoding functions

Structured or free-form search:

SELECT osm_id, ref, lon, lat, boundingbox
FROM nominatim_search(
  server_name => 'osm',
  street => 'Neubrueckenstrasse 63',
  city => 'Muenster',
  country => 'Germany'
);

SELECT osm_id, display_name, lon, lat
FROM nominatim_search(
  server_name => 'osm',
  q => '1600 Pennsylvania Avenue, Washington DC'
);

Reverse lookup:

SELECT osm_id, display_name, boundingbox
FROM nominatim_reverse(
  server_name => 'osm',
  lon => -77.0365,
  lat => 38.8977,
  zoom => 18,
  addressdetails => true
);

OSM object lookup:

SELECT osm_id, display_name
FROM nominatim_lookup(
  server_name => 'osm',
  osm_ids => 'W121736959,R123456'
);

The README notes OSM ID prefixes such as N for nodes, W for ways, and R for relations.

Notes

  • Upstream documents PostgreSQL 12+, libxml2 2.5.0+, and libcurl 7.74.0+.
  • The extension exposes nominatim_fdw_version().
  • The current README documents CREATE EXTENSION ... WITH VERSION '1.3' and ALTER EXTENSION ... UPDATE TO '1.3', so upstream has moved past the requested 1.2 refresh target.

Last Modified 2026-04-19: update extension stub docs (9f178c3)