Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ntkme/postgresql-cidr

:elephant: PostgreSQL cidr extension.
https://github.com/ntkme/postgresql-cidr

cidr inet ipv4 ipv6 plpgsql postgresql postgresql-extension

Last synced: 28 days ago
JSON representation

:elephant: PostgreSQL cidr extension.

Awesome Lists containing this project

README

        

# cidr

![](https://github.com/ntkme/pg_cidr/workflows/build/badge.svg)

## Installation

``` sh
make install
```

### Comparison with Built-In `inet_merge`

| Function | `inet_merge(inet, inet)` | `cidr(inet, inet)` |
|-------------|----------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Return Type | `cidr` | `TABLE (cidr cidr)` |
| Description | the smallest network which includes both of the given networks | the smallest set of network(s) which includes both of the given addresses |
| Example | `inet_merge('8.8.8.8', '8.255.255.255')` | `cidr('8.8.8.8', '8.255.255.255')` |
| Result | `8.0.0.0/8` | `8.8.8.8/29`
`8.8.8.16/28`
`8.8.8.32/27`
`8.8.8.64/26`
`8.8.8.128/25`
`8.8.9.0/24`
`8.8.10.0/23`
`8.8.12.0/22`
`8.8.16.0/20`
`8.8.32.0/19`
`8.8.64.0/18`
`8.8.128.0/17`
`8.9.0.0/16`
`8.10.0.0/15`
`8.12.0.0/14`
`8.16.0.0/12`
`8.32.0.0/11`
`8.64.0.0/10`
`8.128.0.0/9` |