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

Re: BUG #5705: btree_gist: Index on inet changes query result

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andreas Karlsson" <andreas(at)proxel(dot)se>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5705: btree_gist: Index on inet changes query result
Date: 2010-10-11 23:50:06
Message-ID: 8973.1286841006@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Andreas Karlsson" <andreas(at)proxel(dot)se> writes:
> I was looking at the code to see how one would improve indexing of the inet
> types and saw an inconsistency between the compressed format
> (gbt_inet_compress) and how network_cmp_internal works. The btree_gist
> module ignores the netmask.

Well, actually the btree_gist implementation for inet is a completely
broken piece of junk: it thinks that convert_network_to_scalar is 100%
trustworthy and can be used as a substitute for the real comparison
functions, which isn't even approximately true.  I'm not sure why
Teodor implemented it like that instead of using the type's real
comparison functions, but it's pretty much useless if you want the
same sort order that the type itself defines.

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Robert HaasDate: 2010-10-12 00:49:23
Subject: Re: pg_dumpall -> by hand without --binary-upgrade or BUG #5690: pg_upgrade fails
Previous:From: Chris EnglishDate: 2010-10-11 23:37:47
Subject: Re: pg_dumpall -> by hand without --binary-upgrade or BUG #5690: pg_upgrade fails

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