While exploring the OpenLDAP’s backend-sql package, I found below behavior.


The ldap_oc_mappings expects the keycol to be of type integer. For example, if I change the datatype of the identifier (id) of persons table to of type varchar then I am not able to retrieve the persons record during LDAP requests. However, if the column “id” is of type Integer then I am able to view the persons record as part of LDAP search requests.


insert into ldap_oc_mappings (id,name,keytbl,keycol,create_proc,delete_proc,expect_return)

values (2,'inetOrgPerson','persons','id',NULL,NULL,0);


insert into persons (id,name,surname,password) values ('a21qec','Mitya','Kovalev','mit');


1) Is my observation correct? i.e the keycol used to map the LDAP entries to SQL data expects the primary key (id) to be of type integer.

2) If #1 is correct, do we have a way to support VARCHAR datatype for the primary key? In my application, we use GUID (alpha-numeric characters) as the primary key.


Please advise.