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.

PackageSynopsis
gopgext/aggPackage 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/amPackage am writes index access methods in Go: new kinds of indexes, like pgvector’s IVFFlat and HNSW, created with CREATE ACCESS METHOD.
gopgext/authPackage auth hooks into client authentication and password changes: to delay or reject connections (like auth_delay), or enforce password rules (like passwordcheck).
gopgext/brinPackage brin writes BRIN operator classes in Go.
gopgext/fdwPackage fdw writes PostgreSQL foreign data wrappers in Go.
gopgext/ginPackage gin writes the support functions of GIN operator classes in Go: the inverted index of full text search, pg_trgm, jsonb and arrays.
gopgext/gistPackage 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/hooksPackage 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/httpPackage http is an HTTP(S) client for extensions built with gopgext, on libcurl (TinyGo has no net/http here).
gopgext/pgPackage pg is the PostgreSQL API for extensions built with gopgext: logging, errors with SQLSTATE codes, queries (SPI) and settings (GUCs).
gopgext/selectivityPackage 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/shmemPackage 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/spgistPackage 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/subscriptPackage subscript implements subscripting of data types in Go: value[key] to read an element and SET col[key] = x (or x[key] := …
gopgext/tablesamplePackage 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/triggerPackage trigger writes trigger functions in Go.
gopgext/tsearchPackage 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.