tomciopp
Thoughts on getting Postgresql Multiranges added to the postgrex library?
Postgresql added support for multiranges in version 14
I’m looking to add a multirange field to my project but I’m not 100% sure what to do, I think this could be a decent library or an addition to the postgrex library but I’m not certain which is more appropriate. Based off of my reading it looks like I will have to create a new Extension like the library is doing internally.
However, I’m not certain how to determine how these types are encoded and decoded from Postgresql itself. (Can’t seem to find those docs). If anyone has any experience with multiranges in their application, or if there are any of the Postgrex library authors around I’d be happy to collaborate.
Most Liked
ericmj
The wire format of postgres types are unfortunately not documented, instead you have to read the postgres C code. Look for functions named TYPE_send and TYPE_recv for encode and decode respectively.
Here is link to the multirange functions: postgres/multirangetypes.c at master · postgres/postgres · GitHub.







