Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Persistent PostgreSQL: support for "inet" column
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
rekado  
View profile  
 More options May 29 2012, 9:50 am
From: rekado <ricardo.wur...@gmail.com>
Date: Tue, 29 May 2012 06:50:03 -0700 (PDT)
Local: Tues, May 29 2012 9:50 am
Subject: Persistent PostgreSQL: support for "inet" column
Hi list,

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
databases?

Or is there a generic type that I have overlooked that would give me a
simple ByteString without any further modifications?

-- rekado


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.