It seems that with gist_inet_ops the index's opfamily does not support the '<<' operator correctly.
With inet_ops, the query works correctly.
CC'ing Peter to have a look.
Thanks Richard
Hi,
I tried to reproduce this issue on PostgreSQL 18beta2 (commit 3151c264) on Ubuntu 24.04, but I could not observe the incorrect behavior described.
Here’s what I did:
psql (19devel) Type "help" for help.
postgres=# CREATE EXTENSION btree_gist;
CREATE TABLE t AS SELECT '192.168.1.0/25'::inet AS i; CREATE EXTENSION SELECT 1 postgres=# CREATE INDEX ON t USING gist(i); CREATE INDEX postgres=# SELECT * FROM t WHERE i << '192.168.1.0/24'::cidr; i ---------------- 192.168.1.0/25 (1 row)
So the query still returns the expected row after the GiST index is created. If there are any additional settings or steps required to reproduce, please let me know.