Re: [HACKERS] CIDR type and functions - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] CIDR type and functions
Date
Msg-id 199810090500.BAA28109@candle.pha.pa.us
Whole thread Raw
In response to CIDR type and functions  (darcy@druid.net (D'Arcy J.M. Cain))
Responses Re: [HACKERS] CIDR type and functions  (darcy@druid.net (D'Arcy J.M. Cain))
List 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@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026


pgsql-hackers by date:

Previous
From: "Thomas G. Lockhart"
Date:
Subject: Re: [HACKERS] man page installation patch
Next
From: Tom Ivar Helbekkmo
Date:
Subject: Re: [HACKERS] Open 6.4 items