Prefix search functionality for PostgreSQL
prefix
extension provides efficient prefix (starts-with) search functionality in PostgreSQL.
While it’s useful for implementing autocomplete features and prefix-based filtering, it’s particularly
important in telephony applications where call routing and costs depend on matching phone numbers
to operator prefixes.
Your Nile database arrives with the prefix
extension already enabled.
prefix
extension introduces operators on prefix ranges:
@>
: Checks if the prefix range contains the given number or range<@
: Checks if the prefix range or numberis contained within another prefix range&&
: Checks for overlapping prefix ranges|
: Is union of two prefix ranges&
: Is intersection of two prefix ranges<=
, >=
, <
, >
, =
, <>
are supported for prefix ranges.