Re: [HACKERS] CIDR type and functions

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: darcy(at)druid(dot)net (D'Arcy J(dot)M(dot) Cain)
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] CIDR type and functions
Date: 1998-10-09 05:00:45
Message-ID: 199810090500.BAA28109@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Just curious, what functions did we finally settle on for this type?
> I ask because I just thought of another function that might be useful.
>
> select block(cidr1, cidr2);
>
> to return 1 if cidr2 is part of the cidr1 block, -1 if cidr1 is part
> of the cidr2 block and 0 if neither.
>

Check \df and \fo. There is a >> and << operators that do subnet
testing.

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

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Ivar Helbekkmo 1998-10-09 08:50:00 Re: [HACKERS] Open 6.4 items
Previous Message Thomas G. Lockhart 1998-10-09 05:00:32 Re: [HACKERS] man page installation patch