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

Re: [HACKERS] New INET and CIDR types

From: darcy(at)druid(dot)net (D'Arcy J(dot)M(dot) Cain)
To: lockhart(at)alumni(dot)caltech(dot)edu (Thomas G(dot) Lockhart)
Cc: maillist(at)candle(dot)pha(dot)pa(dot)us (Bruce Momjian), hackers(at)postgreSQL(dot)org, paul(at)vix(dot)com
Subject: Re: [HACKERS] New INET and CIDR types
Date: 1998-10-29 13:53:05
Message-ID: m0zYsVd-0000eRC@druid.net (view raw or flat)
Thread:
Lists: 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 AS sb, i <<= c AS sbe, i >> c AS sup, i >>= c AS spe
    FROM INET_TBL;

-- 
D'Arcy J.M. Cain <darcy(at){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.

In response to

pgsql-hackers by date

Next:From: Giuseppe TanzilliDate: 1998-10-29 14:31:12
Subject: beta3 compile problem
Previous:From: D'Arcy J.M. CainDate: 1998-10-29 13:15:31
Subject: Re: [HACKERS] Bug in current network.c

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