RE: RE: even more CIDR weirdness (was equality operator on CIDR colum n as primary key)

From: "Mayers, Philip J" <p(dot)mayers(at)ic(dot)ac(dot)uk>
To: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: RE: RE: even more CIDR weirdness (was equality operator on CIDR colum n as primary key)
Date: 2000-08-30 14:51:16
Message-ID: A0F836836670D41183A800508BAF190B35E044@icex1.cc.ic.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hmm. Hopefully that will sort the problem out.

I am fairly sure it's index-related - if a CIDR-type column is either a
PRIMARY KEY or explicitly set to UNIQUE, i.e. any indices on the column, the
equality operator fails. No index = works fine.

Does that tally with the problem you mentioned?

Regards,
Phil

+----------------------------------+
| Phil Mayers, Network Support |
| Centre for Computing Services |
| Imperial College |
+----------------------------------+

-----Original Message-----
From: Stephan Szabo [mailto:sszabo(at)megazone23(dot)bigpanda(dot)com]
Sent: 30 August 2000 15:37
To: Mayers, Philip J
Cc: 'pgsql-general(at)postgresql(dot)org'
Subject: Re: [GENERAL] RE: even more CIDR weirdness (was equality
operator on CIDR colum n as primary key)

IIRC, there were some problems with CIDR where it was considering
the low bits significant even though they might not have been set
(in the case of 192.169/16 for example) which was causing fairly
odd behavior.

I believe they've routed out these problems in current sources
so it should be fixed for 7.1.

Stephan Szabo
sszabo(at)bigpanda(dot)com

On Wed, 30 Aug 2000, Mayers, Philip J wrote:

>
> Ok, now I'm getting truly confused. It works with some networks, but not
> with others:
>
>
> test=> select * from test;
> network | netcol
> ----------------+--------
> 192.168/16 | 192/8
> 192/8 | 192/4
> 155.198/16 |
> 155.198.1/24 |
> 156.198/16 |
> 156.198.1/24 |
> 193.63.75.0/27 |
> (7 rows)
>
> test=> select * from test where network = '192.168/16';
> network | netcol
> ---------+--------
> (0 rows)
>
> test=> select * from test where network = '193.63.75.8/27';
> network | netcol
> ----------------+--------
> 193.63.75.0/27 |
> (1 row)
>
> test=> select * from test where network = '193.63.75.8/27';
> network | netcol
> ----------------+--------
> 193.63.75.0/27 |
> (1 row)
>
> test=> select * from test where network = '155.198/16';
> network | netcol
> ---------+--------
> (0 rows)

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-08-30 14:55:58 Re: equality operator on CIDR column as primary key
Previous Message Tom Lane 2000-08-30 14:44:38 Re: foreign keys - script