0

How do you store floating-point numbers / real numbers in OpenLDAP? I have never seen such a data type. I know you could store a string representation of a floating-point number, but that sounds like an awful practice.

2 Answers 2

0

You can shove arbitrary data into an OpenLDAP server, though it's likely to get base64 encoded and decoded along the way, much like sending an email attachment.

It's the matching and ordering rules that could get complicated.


The most likely candidate would be an OctetString.

EQUALITY octetStringMatch ORDERING octetStringOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40

You should be able to use it to store arbitrary data. (You may not want to include ordering as it's unlikely to achieve the desired effect.)

You may consider limiting the number of bits by tacking a byte limit on the end of the syntax OID. E.g. 1.3.6.1.4.1.1466.115.121.1.40{8}.

-1

LDAP stores all numbers as strings, but you can configure matching rules in your schema that will treat them as actual numbers for ordering purposes.

1
  • There are no standard LDAP matching rules for floating point string representation. And one cannot add matching rules to a LDAP server just by configuration. Jul 30, 2019 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.