I currently writing a frontend for an existing PostgreSQL database
that uses the "inet" column to store IP addresses and networks.
Persistent's PostgreSQL backend currently doesn't support this column
type, probably in part because there are no conversion functions for
this column type in postgresql-simple.
As the "inet" column type can contain IPv4 and IPv6 addresses as well
as networks there is no simple one-to-one mapping from column type to
Haskell type (there is Data.IP and Data.Network.Address for the
possible types, though).
I'd like to write a patch to add support for this column, but I don't
know what the prefered way to do this would be in this situation.
Should Persistent simply return a ByteString and leave the conversion
task up to the application (ugly)? Or should I specify four new column
types (IPv4 address, IPv6 address, IPv4 network, IPv6 network) in the
hope that the column is used only for one type of thing in existing
Or is there a generic type that I have overlooked that would give me a
simple ByteString without any further modifications?