prefix
Prefix Range module for PostgreSQL
Repository
dimitri/prefix
https://github.com/dimitri/prefix
Source
prefix-1.2.11.tar.gz
prefix-1.2.11.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_prefix | 1.2.11 | TYPE | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 3500 | prefix | No | Yes | No | Yes | No | Yes | - |
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PGDG | 1.2.11 | 1817161514 | pg_prefix | - |
| RPM | PGDG | 1.2.11 | 1817161514 | prefix_$v | - |
| DEB | PGDG | 1.2.11 | 1817161514 | postgresql-$v-prefix | - |
Build
You can build the RPM packages for pg_prefix using pig build:
Install
You can install pg_prefix directly. First, make sure the PGDG repository is added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
Usage
The prefix extension provides a prefix_range data type for efficient prefix matching, particularly useful for telephony call routing.
Data Type
Create prefix_range values using the constructor or text casting:
Operators
| Operator | Description |
|---|---|
@> | Contains (prefix contains value) |
<@ | Is contained by |
&& | Overlaps |
| | Union |
& | Intersection |
=, <>, <, >, <=, >= | Comparison |
Examples
Index Support
Create a GiST index for efficient prefix lookups:
The index accelerates @>, <@, &&, and = operators.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)