OpenLDAP-POSTGRESQL HOWTO

Gilles DAROLD, gilles __AT__ darold __DOT__ net

v3.4, 08 Sep 2012

Replace "insentry_query" variable in slapd.conf by "insentry_stmt", this directive has been renamed since version 1.2 of this file. Thanks to David Hornung for the report.

v3.3, 05 Sep 2011

Add information on how to test the ODBC connection using the UnixODBC isql command line utility.

v3.2, 29 Jul 2010

Add information on to obtain iodbctest when it is not installed and give information on troubleshooting slapd when it crash (section 5.6).
Thank to Aleksandar Stoisavljevic for the report.

v3.1, 28 Jun 2010

Fix errata in Configuration/3.2.1 on the path to slapd.conf in OpenLDAP source. Thank to Humberto Fuentealba for the report.

v3.0, 29 Apr 2010

This new release is a complete review of the HOWTO to have it working with all latest release of OpenLDAP, PostgreSQL, pgsql-odbc and ODBC. I've also rewritten all SQL and LDIFF samples code.

This HOWTO is proved to work with PostgreSQL 8.4.3, OpenLDAP 2.4.21, unixODBC 3.2.0 and psqlodbc 08.04.0200.

Note that the use of libiodbc have been removed to the benefice of unixODBC because of a bug that makes slapd hang during the backsql_load_schema_map() call.

v2.2, 23 Apr 2010:

Upgrade this HOWTO for use with latest releases. Thanks to Aleksandar Stoisavljevic for report and all fixes.

- Add replacement of library psqlodbc.so by psqlodbcw.so
- Add replacement of program odbctest by iodbctest
- Remove reference to table ldap_referrals, no more used in latest OpenLDAP.
- Remove slapd.conf defaultaccess directive, obsolete.

v2.1, 11 Feb 2010: Add answers of common install problems. Thanks to Cristina Arias for the report.

v2.0, 15 Jan 2003

v1.0, 14 August 2001


Table of Contents
1. Introduction
1.1. Why a HOWTO ?
1.2. Why a PostgreSQL backend ?
1.3. Want to know more ?
2. Installation
2.1. PostgreSQL
2.2. UnixODBC vs iODBC
2.3. PostgreSQL ODBC Driver
2.4. OpenLDAP
3. Configuration
3.1. ODBC
3.2. OpenLDAP
3.3. PostgreSQL
4. Testing the ODBC installation
5. Testing the LDAP directory
5.1. Performing a search
5.2. Creating entry
5.3. Adding/Deleting/Modifying entry attribute
5.4. Performing a search
5.5. Deleting entry
5.6. Troubleshooting
6. A live example
6.1. The LDAP Schema
6.2. The back-sql LDAP configuration
6.3. Creating the PostgreSQL backend