Bug 231748 - [NEW PORT] databases/prefix: Prefix Range module for PostgreSQL
Summary: [NEW PORT] databases/prefix: Prefix Range module for PostgreSQL
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: David Naylor
URL: https://github.com/dimitri/prefix
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-26 20:23 UTC by Loïc Bartoletti
Modified: 2018-12-14 19:54 UTC (History)
2 users (show)

See Also:


Attachments
databases/prefix (4.65 KB, patch)
2018-09-26 20:23 UTC, Loïc Bartoletti
lbartoletti: maintainer-approval+
Details | Diff
databases/prefix (4.63 KB, patch)
2018-09-27 04:30 UTC, Loïc Bartoletti
lbartoletti: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Loïc Bartoletti freebsd_committer freebsd_triage 2018-09-26 20:23:30 UTC
Created attachment 197533 [details]
databases/prefix

This module is written by Dimitri Fontaine with a great amount of help from RhodiumToad (formely known as AndrewSN), who was the one advising for a GiST opclass to solve the prefix matching problem.

Prefix matching is both very common and important in telephony applications, where call routing and costs depend on matching caller/callee phone number to an operator prefix.

Let's say the prefixes table is called prefixes, a typical query will try to match a phone number to the longest prefix in the table:

SELECT *
  FROM prefixes
 WHERE prefix @> '0123456789'
ORDER BY length(prefix) DESC LIMIT 1;
Comment 1 Nathan 2018-09-26 22:23:42 UTC
Comment on attachment 197533 [details]
databases/prefix

#LLD_UNSAFE=	yes
Instead of commenting it out, remove if not used

.for i in README.md TESTS.md
+		${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR}
+.endfor

Why use loop to install two files?
(cd ${WRKSRC} ; ${INSTALL_DATA} README.md TESTS.md ${STAGEDIR}${DOCSDIR})
Comment 2 Loïc Bartoletti freebsd_committer freebsd_triage 2018-09-27 04:30:23 UTC
Created attachment 197542 [details]
databases/prefix

You're right, it's fixed.
Comment 3 David Naylor freebsd_committer freebsd_triage 2018-12-12 07:47:52 UTC
I'll test out this port today...
Comment 4 David Naylor freebsd_committer freebsd_triage 2018-12-14 19:54:23 UTC
Committed in 487459 with minor edits:
 - Cleaned up Makefile (no need for LLD_UNSAFE)
 - Removed first paragraph from pkg-descr (to me it didn't seem to be part of the description of the package functionality - if you disagree please state here and I'll reinstate it)
 - Removed extra white spaces in pkg-descr