Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Re: [BUGS] uniqueness not always correct

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Vadim Mikheev <vadim(at)krs(dot)ru>, Frank Cusack <fcusack(at)iconnet(dot)net>, pgsql-bugs(at)postgreSQL(dot)org, PostgreSQL Developers List <hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Re: [BUGS] uniqueness not always correct
Date: 2000-03-07 22:50:57
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugspgsql-hackers
I have just applied a user patch to fix this reported problem.

> Vadim Mikheev <vadim(at)krs(dot)ru> writes:
> > Yes, I reproduced this (Solaris 2.5/sparc). 
> > Seems like CIDR problem(??!):
> Yes.  Looks like the low-order bits of a CIDR address are garbage,
> but network_cmp() compares them as though all bits are significant.
> So, indeed, it may think two different instances of '1.2.3/24'
> are not equal.
> The regular inet comparison functions at least *try* to mask out
> garbage bits, but I think they get it wrong too --- they should be
> taking the smaller of ip_bits(a1) and ip_bits(a2) as the number of
> bits to compare.  They don't.  Thus, for example,
> regression=> select '1.2.5/16'::cidr < '1.2.3/24'::cidr;
> ?column?
> --------
> f
> (1 row)
> which looks wrong to me.
> In short, it's a bug in the inet data types, not a generic problem
> with unique indexes.
> 			regards, tom lane
> ************

  Bruce Momjian                        |
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to


pgsql-hackers by date

Next:From: The Hermit HackerDate: 2000-03-07 23:06:24
Subject: Re: [HACKERS] library policy question
Previous:From: Ross J. ReedstromDate: 2000-03-07 19:41:54
Subject: Re: [HACKERS] CREATE VIEW fix

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2000-03-07 23:09:45
Subject: Re: [BUGS] pg_dumpall
Previous:From: Jerome ALETDate: 2000-03-07 10:05:46
Subject: Re: [BUGS] grant/revoke bug with delete/update

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group