Re: [BUGS] INET operators and NOT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tomas Cerha <t(dot)cerha(at)sh(dot)cvut(dot)cz>
Cc: pgsql-bugs(at)postgreSQL(dot)org, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [BUGS] INET operators and NOT
Date: 1999-12-28 23:35:44
Message-ID: 29304.946424144@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Tomas Cerha <t(dot)cerha(at)sh(dot)cvut(dot)cz> writes:
> Aplying the NOT operator with << INET operator results always in false.

> accounting=> SELECT * FROM a;
> ip
> --------
> 10.1.1.1
> 10.1.1.2
> 10.2.1.2
> 10.2.1.1
> (4 rows)

> accounting=> SELECT * FROM a WHERE ip<<'10.1/16';
> ip
> --------
> 10.1.1.1
> 10.1.1.2
> (2 rows)

> accounting=> SELECT * FROM a WHERE NOT ip<<'10.1/16';
> ip
> --
> (0 rows)

What's going on here is that the optimizer is simplifying "NOT x<<y"
(network_sub) into "x>>=y" (network_supeq), because the pg_operator
entry for << claims that >>= is its negator. This example demonstrates
that that ain't so.

Can anyone comment on whether any of the inet operators are actually the
correct negator of << ? For that matter, are inet's other commutator
and negator declarations just as broken?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Erix MOLINIE 1999-12-29 08:03:51 unsubscribe
Previous Message Samuel A Horwitz 1999-12-28 20:30:48 rs6000-aix4.2.1.0 - build failure

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 1999-12-29 02:00:08 RE: [HACKERS] can't link libpq.so(inet_aton() not found)
Previous Message Peter Eisentraut 1999-12-28 22:14:17 Re: [HACKERS] dubious improvement in new psql