This recipe shows you how to set up your PostgreSQL system so that it uses the Lightweight Directory Access Protocol (LDAP) for authentication.
Ensure that the usernames in the database and your LDAP server match, as this method works for user authentication checks of users who are already defined in the database.
Unfortunately, as LDAP is used only to validate username/password pairs, this method cannot use the PostgreSQL User Name Map feature to allow a single LDAP user to connect as multiple database users.