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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-committers by date

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