Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/ntkme/postgresql-cidr
- Owner: ntkme
- License: mit
- Created: 2020-05-16T07:57:54.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-04T17:30:27.000Z (about 1 year ago)
- Last Synced: 2024-09-28T18:23:25.253Z (about 1 month ago)
- Topics: cidr, inet, ipv4, ipv6, plpgsql, postgresql, postgresql-extension
- Language: PLpgSQL
- Homepage:
- Size: 6.84 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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` |