Definitional issue for INET types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Definitional issue for INET types
Date: 2000-02-17 07:25:13
Message-ID: 14929.950772313@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I tried fixing some of the known problems with comparison of INET values
(cf. thread "uniqueness not always correct" on 11/11/99, among others),
and was surprised to discover that my changes affected the results of
the inet regress test. Specifically, the regress test exercises all the
inet comparison operators on the two data values
'10.1.2.3/8'::inet '10.0.0.0/32'::cidr
The old code believes that the first of these is greater, while my
revised code thinks the second is greater.

Now, my understanding of things is that '10.1.2.3/8' is just an
unreasonably verbose way of writing '10/8', because if you write /8
you are saying that only the first 8 bits mean anything. So it seems
to me that we are really comparing '10/8' and '10.0.0.0/32', and the
former should be considered the lesser in the same way that 'ab'
comes before 'abc' in dictionaries.

Is the regress test's expected output wrong, or have I missed
something?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-02-17 07:28:04 Re: [HACKERS] Almost there on column aliases
Previous Message Thomas Lockhart 2000-02-17 07:14:26 Re: [HACKERS] ERROR: Unable to identify an operator '=' for types 'numeric' and 'float8'