ldap_fdw
ldap_fdw · Foreign data wrapper for querying LDAP servers
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100101 | ldap_fdw | ldap_fdw | 0.1.1 | FDW | PostgreSQL | C |
Usage
Sources:
ldap_fdw is an experimental, read-only foreign data wrapper that exposes LDAP entries as two-column PostgreSQL rows. The 0.1.1 documentation targets PostgreSQL 9.2 and explicitly says not to use the software in production. It lacks TLS, paging, write support, and a modern security model.
Core Workflow
Define an LDAP server and binding credentials, then create a foreign table with exactly dn and object_body text columns:
Important Objects
ldap_fdwis the wrapper and uses a synchronous LDAP client.addressandportare server options; the default port is 389.user_dnandpasswordare user-mapping options.base_dnis required for a foreign table, whileattributeslimits returned attributes.dnis the entry distinguished name andobject_bodyis Hstore-compatible text.
Security and Query Limits
Only equality on dn is pushed down. Other scans perform a one-level search below the base DN, without paging or SQL LIMIT pushdown, so an LDAP server result cap can silently truncate results. The implementation uses a simple bind over an unencrypted connection and stores credentials in PostgreSQL catalogs. Keep it away from real credentials and sensitive directory attributes; use a maintained integration with TLS and paging instead.