API reference
The Go packages extensions import, generated from their doc comments.
Generated from the packages’ doc comments. Import them from your project’s Go code.
| Package | Synopsis |
|---|---|
| gopgext/agg | Package agg writes aggregates whose state is a Go value (transition type internal): a slice of values for a median, a map for a mode, a sketch… |
| gopgext/am | Package am writes index access methods in Go: new kinds of indexes, like pgvector’s IVFFlat and HNSW, created with CREATE ACCESS METHOD. |
| gopgext/auth | Package auth hooks into client authentication and password changes: to delay or reject connections (like auth_delay), or enforce password rules (like passwordcheck). |
| gopgext/brin | Package brin writes BRIN operator classes in Go. |
| gopgext/fdw | Package fdw writes PostgreSQL foreign data wrappers in Go. |
| gopgext/gin | Package gin writes the support functions of GIN operator classes in Go: the inverted index of full text search, pg_trgm, jsonb and arrays. |
| gopgext/gist | Package gist writes the support functions of GiST operator classes in Go: the index method PostGIS, ltree, cube, pg_trgm, range types and many others use. |
| gopgext/hooks | Package hooks observes the statements a backend processes, through PostgreSQL’s query processing hooks (post parse analysis, planner, executor and utility hooks): to collect statistics like pg_stat_statements, log slow statements, audit… |
| gopgext/http | Package http is an HTTP(S) client for extensions built with gopgext, on libcurl (TinyGo has no net/http here). |
| gopgext/pg | Package pg is the PostgreSQL API for extensions built with gopgext: logging, errors with SQLSTATE codes, queries (SPI) and settings (GUCs). |
| gopgext/selectivity | Package selectivity writes the selectivity estimators of operators in Go: the RESTRICT function (the fraction of a table’s rows “column op value” matches) and the JOIN function (the fraction of the pairs of rows “a op b” matches), which the planner uses to choose plans. |
| gopgext/shmem | Package shmem shares state between the backends of a server: shared memory and locks, for libraries loaded by shared_preload_libraries (statistics like pg_stat_statements, caches, counters…). |
| gopgext/spgist | Package spgist writes the support functions of SP-GiST operator classes in Go: space-partitioned trees (quadtrees, k-d trees, radix trees, …), the index method behind PostgreSQL’s point, range, inet and text prefix operator classes. |
| gopgext/subscript | Package subscript implements subscripting of data types in Go: value[key] to read an element and SET col[key] = x (or x[key] := … |
| gopgext/tablesample | Package tablesample writes TABLESAMPLE methods in Go: which blocks of a table a sample scan reads and which tuples of each block it returns (SELECT … |
| gopgext/trigger | Package trigger writes trigger functions in Go. |
| gopgext/tsearch | Package tsearch writes full text search dictionary templates and parsers in Go, and gives Go code PostgreSQL’s text search services: data files in $SHAREDIR/tsearch_data, lower-casing, and calling dictionaries. |