ruby-pg icon indicating copy to clipboard operation
ruby-pg copied to clipboard

inet type is converted to IPAddr which clears the host part

Open vihai opened this issue 3 years ago • 0 comments

Hello,

I've read the description of pull request #27 but in my opinion it is hiding a major issue in how IPAddr treats interface addresses.

IPAddr does not have a distinction between IP addresses, Interface addresses (IP+length), Networks (Prefix+Length) and tries (with little success IMHO) to use a single class to represent everything.

PostgreSQL inet type's purpose is to contain addresses or interface addresses; 192.168.0.1/24 is a valid interface address.

When stored in an inet type, it gets automatically cast to an IPAddr which, however, clears the host part, corrupting the value.

vihai avatar Aug 29 '20 23:08 vihai