ip4r
IPv4/v6 and IPv4/v6 range index type for PostgreSQL
ip4r : IPv4/v6 and IPv4/v6 range index type for PostgreSQL
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 3790 | ip4r | ip4r | 2.4.3 |
TYPE | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
| Relationships | |
|---|---|
| Need By | geoip |
| See Also | prefix geoip postgis uri nominatim_fdw pg_sphere earthdistance q3c |
Packages
| Linux / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 |
| el8.aarch64 | N/A | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 |
| el9.x86_64 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 |
| el9.aarch64 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 |
| el10.x86_64 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 |
| el10.aarch64 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 |
| d12.x86_64 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 |
| d12.aarch64 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 |
| d13.x86_64 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 |
| d13.aarch64 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 |
| u22.x86_64 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 |
| u22.aarch64 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 |
| u24.x86_64 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 |
| u24.aarch64 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 |
| u26.x86_64 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 |
| u26.aarch64 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 | PGDG 2.4.3 |
Source
github.com/RhodiumToad/ip4r
Install
Make sure PGDG repo available:
Install this extension with pig:
Create this extension with:
Usage
The ip4r extension provides specialized data types for IPv4/IPv6 addresses and ranges with superior indexing for containment queries.
Data Types
| Type | Description |
|---|---|
ip4 |
Single IPv4 address (32-bit) |
ip6 |
Single IPv6 address (dual 64-bit) |
ip4r |
IPv4 address range |
ip6r |
IPv6 address range |
ipaddress |
Mixed IPv4/IPv6 address |
iprange |
Mixed IPv4/IPv6 range |
Address Input
Address Operators
- Comparison:
=,<>,<,>,<=,>= - Arithmetic:
+,-with integers - Bitwise:
&(AND),|(OR),#(XOR),~(NOT)
Address Functions
Range Operators
| Operator | Description |
|---|---|
>>= |
Contains or equal |
>> |
Strictly contains |
<<= |
Contained in or equal |
<< |
Strictly contained in |
&& |
Overlaps |