Re: postgres - development of inet/cidr - Mailing list pgsql-hackers

From darcy@druid.net (D'Arcy J.M. Cain)
Subject Re: postgres - development of inet/cidr
Date
Msg-id m137zNZ-000AUWC@druid.net
Whole thread Raw
List pgsql-hackers
Thus spake Jakub Bartosz Bielecki
> I'm not really into PostgreSQL development, first of all.
> However once I have needed to use INET type
> in my database and (sadly) I noticed 2 very serious bugs:
> 
> 1. all functions which return text (host, network etc) should
>     return pascal-like ASCII string not C-like ASCIIZ
>    example:
>     select host('10.0.0.1')='10.0.0.1';  -- this returns false!
> 
> 2. inet comparison routines (and thus operators) work in a strange way 
>    if I set netmask length to a non-default value (other than 32).
>    example:
>     select '10.0.0.1/27'::inet='10.0.0.2/27'::inet;  -- returns true
>    I guess that this behaviour is different from described in manual.
>    And if it's right, then in surce code is 1 function which behaves
>    in an opposite way, messing the whole thing up...
> 
> I noticed these in Pg 6.5.3, however when I checked apropriate source file
> in Pg 7.0, to my suprise it was not fixed...
> 
> OK. Now my questions:
> - am I right?
> - are you working on it?
> - if not, should I fix it myself and send a patch to developers?
>   (I really dont feel like duplicating someones work)

I am working on different things right now so go ahead but do discuss your
proposed changes on hackers first (pgsql-hackers@PostgreSQL.org) as there
was quite a lot of discussion at the time about how it should work.


-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Minor buglet in update...from (I think)
Next
From: Brook Milligan
Date:
Subject: Re: Changes to handling version numbers internally