Re: [HACKERS] New INET and CIDR types - Mailing list pgsql-hackers

From darcy@druid.net (D'Arcy J.M. Cain)
Subject Re: [HACKERS] New INET and CIDR types
Date
Msg-id m0zYsVd-0000eRC@druid.net
Whole thread Raw
In response to Re: [HACKERS] New INET and CIDR types  ("Thomas G. Lockhart" <lockhart@alumni.caltech.edu>)
List pgsql-hackers
Thus spake Thomas G. Lockhart
> So, things like (don't know if this exact example is sensible):
> 
>   select '' as count, c as cidr from inet_tbl
>     where c < '128.149.50' and c > '128.149';

Of course.  I only sent in tests for the functions I added.  Ok, add
the following two INSERT statements.

INSERT INTO INET_TBL (c, i) VALUES ('10', '11.1.2.3/8');
INSERT INTO INET_TBL (c, i) VALUES ('10', '9.1.2.3/8'); 

Then add the following query.

SELECT i, c,       i < c AS lt, i <= c AS le, i = c AS eq,        i >= c AS ge, i > c AS gt, i <> c AS ne,       i << c
ASsb, i <<= c AS sbe, i >> c AS sup, i >>= c AS spe   FROM INET_TBL;
 

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.


pgsql-hackers by date:

Previous
From: darcy@druid.net (D'Arcy J.M. Cain)
Date:
Subject: Re: [HACKERS] Bug in current network.c
Next
From: Giuseppe Tanzilli
Date:
Subject: beta3 compile problem