pgelog
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pgelog | 1.0.2 | ADMIN | PostgreSQL | SQL |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 5870 | pgelog | No | No | No | Yes | No | No | - |
| Related | dblink pg_variables pg_stat_log logerrors pgaudit table_log pg_drop_events pgmemento pg_auth_mon pg_sqlog log_fdw pgdisablelogerror |
|---|
Release tag 1.0.2 still ships extension SQL version 1.0; requires the dblink extension at runtime in addition to pg_variables.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0.2 | 1817161514 | pgelog | dblink, pg_variables |
| RPM | PIGSTY | 1.0.2 | 1817161514 | pgelog_$v | postgresql$v-contrib, pg_variables_$v |
| DEB | PIGSTY | 1.0.2 | 1817161514 | postgresql-$v-pgelog | postgresql-$v-pg-variables |
Build
You can build the RPM / DEB packages for pgelog using pig build:
Install
You can install pgelog directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
Source: README, control file, extension SQL 1.0.2, Tag v1.0.2
pgelog writes rollback-resistant log rows through pseudo-autonomous transactions implemented with dblink. It caches the extra connection in pg_variables so repeated logging in the same session is cheaper.
Requirements and install
- PostgreSQL 11+
dblinkpg_variables- passwordless local
dblinkaccess, typically viapeer
Main objects and functions
pgelog_logs: base log table.pgelog_vw_logs: log view with timing deltas.pgelog_params: configuration table.pgelog_to_log(...): write a log row that survives rollback.pgelog_get_param(...),pgelog_set_param(...),pgelog_delete_param(...): manage extension settings.
Typical use
The official README shows pgelog_to_log(...) in PL/pgSQL exception handlers: collect diagnostics with GET STACKED DIAGNOSTICS, write a FAIL log row, then re-raise the error.
Caveats
- Each session can open one additional
dblinkconnection, somax_connectionsshould account for that. - Upstream
v1.0.2still ships extension SQL under the same user-visible object family; Pigsty’s note about runtimedblinkpluspg_variablesrequirements is confirmed by the control file and README.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)