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

Re: [HACKERS] Re: INET operators and NOT

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: Tomas Cerha <t(dot)cerha(at)sh(dot)cvut(dot)cz>, pgsql-bugs(at)postgreSQL(dot)org, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Re: INET operators and NOT
Date: 2000-06-01 22:23:18
Message-ID: 200006012223.SAA03335@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
Here is Tom Lane's comment.

> 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
> 
> ************
> 


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  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

Responses

pgsql-hackers by date

Next:From: Jacques HuardDate: 2000-06-01 22:29:16
Subject: OID question
Previous:From: Bruce MomjianDate: 2000-06-01 22:22:10
Subject: Re: INET operators and NOT

pgsql-bugs by date

Next:From: Tom LaneDate: 2000-06-01 22:42:28
Subject: Re: [HACKERS] Re: INET operators and NOT
Previous:From: Bruce MomjianDate: 2000-06-01 22:22:10
Subject: Re: INET operators and NOT

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