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

Re: pgsql: Add INET/CIDR operators: and, or, not, plus

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Add INET/CIDR operators: and, or, not, plus
Date: 2006-02-11 19:46:42
Message-ID: 23282.1139687202@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-committers
Actually this patch has got some worse problems:

regression=# select '127.0.0.1'::inet + 256;
 ?column?  
-----------
 127.0.2.1
(1 row)

which is wrong; if that's not obvious try

regression=# select ('127.0.0.1'::inet + 256) - 256;
 ?column?  
-----------
 127.0.1.1
(1 row)

or

regression=# select '127::2'::inet  - ('127::2'::inet - 256);
 ?column? 
----------
   -65280
(1 row)

I think the overflow checks are wrong, and the current buildfarm
results say there's a portability problem too.  Working on it now...

			regards, tom lane

In response to

pgsql-committers by date

Next:From: Tom LaneDate: 2006-02-11 20:39:59
Subject: pgsql: Fix incorrect addition, subtraction, and overflow checking in new
Previous:From: Andrew DunstanDate: 2006-02-11 19:36:52
Subject: Re: [COMMITTERS] pgsql: Enable pg_ctl to give up admin

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