Skip to content

AddressForAll/pg_pubLib-v1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

PostgreSQL's Public schema common Library (pg_PubLib) version 1

Set of PostgreSQL funcions distributed by CC0 License. Plese cite this git by its canonical URL, http://git.addressforall.org/pg_pubLib

PubLib is an effort to reduce the impact of the "historic rationale" used by PostgreSQL developer team, like the lack of overloads in some native functions, as the round() function, or the lack of orthogonality in overloads and casts. PubLib is also a Library of Snippets, implementating small and frequently used functions. Typical "small function" are also IMMUTABLE ones.

Usage recomendation

Your project not need to copy all source-code of this git. Select only the SQL files (group of functions) that your project need, maintaining it updated to be compatible with newer ones. If this git is updated, you can update also your subset of selected functions.

All other projects, in the same database or same "ecosystem", will use the same function names and same git reference for updates.

Lib Organization

Functions are grouped in thematic source-files to maintainability. Most of the thematic groups comes from PostgreSQL Documentation's "Chapter 9. Functions and Operators". Others are inspired in "snippet classes".

Function group Labels Inspiration / dependence
(System) Administration (src admin pg/docs/functions-admin) / string.
Aggregate (src agg, aggregate pg/docs/functions-aggregate) / array, json, sring.
Array (src) array pg/docs/functions-array (no dependency).
GeoJSON (src) geoJSON PostGIS/GeoJSON / pgis, json, admin.
JSON (src) json, jsonb pg/docs/functions-json / array.
PostGIS (src) st, postGis PostGIS/docs / (fixed level-04 dependencies).
String (src) str, string pg/docs/functions-string (no dependency).
HCodes (src) hcode, distrib (Hierarchical or) Natural Codes / json, array.
Geohash (src) geohash, postGis PostGIS/Geohash / hcodes, pgis.

Libs also labeled by "dependence level"; for example Array library has no dependence, is level 01; JSON depends on Array, is level 03; and GeoJSON library depends on JSON, is level 4. The installation order is the dependency level.

Installation

See docs/install.md, using make.