BUG #11734: The "<<=" operator on "inet" values does not return the expected result.

From: michel(at)albert(dot)lu
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #11734: The "<<=" operator on "inet" values does not return the expected result.
Date: 2014-10-21 11:40:40
Message-ID: 20141021114040.2674.45532@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 11734
Logged by: Michel Albert
Email address: michel(at)albert(dot)lu
PostgreSQL version: 9.1.14
Operating system: Ubuntu 12.04.5 LTS

Just now I ran into a peculiarity with the '<<=' operator. I have a table
which contains both "network" and "host" entries. Their addresses are stored
as type "inet".

I am aware that it is conceptually bad to have both hosts and networks
in the same table, and it is planned to be changed in the future. But for
now, that's how it is.

The best way to explain this is with a quick example script:

CREATE TABLE inettest (
value inet UNIQUE


SELECT * FROM inettest WHERE value <<= ''::inet;

I would expect that the above select would only return *one* row. The one
with the host ''. Instead, it returns *all* rows of the
'' network.

I am not sure if this result is correct (by design), or if it is indeed a
bug. In any case, I have solved the issue on my end in the client code, but
thought I would let you know nonetheless :)


Browse pgsql-bugs by date

  From Date Subject
Next Message chenhj 2014-10-21 16:09:04 Re: 32 bit libpq fail to connecting when set a very large "connect_timeout" value
Previous Message pbailis 2014-10-21 07:14:58 BUG #11732: Non-serializable outcomes under serializable isolation