pgelog
Extended logging via pseudo-autonomous transactions
pgelog : Extended logging via pseudo-autonomous transactions
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 5870 | pgelog | pgelog | 1.0.2 |
ADMIN | PostgreSQL | SQL |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| ----d-- | No | No | No | Yes | no | no |
| Relationships | |
|---|---|
| Requires | dblink pg_variables |
| See Also | 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.
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0.2 |
18 17 16 15 14 | pgelog |
dblink, pg_variables |
| RPM | PIGSTY | 1.0.2 |
18 17 16 15 14 | pgelog_$v |
postgresql$v-contrib, pg_variables_$v |
| DEB | PIGSTY | 1.0.2 |
18 17 16 15 14 | postgresql-$v-pgelog |
postgresql-$v-pg-variables |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| el8.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| el9.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| el9.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| el10.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| el10.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| d12.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| d12.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| d13.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| d13.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| u22.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| u22.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| u24.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| u24.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| u26.x86_64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
| u26.aarch64 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 | PIGSTY 1.0.2 |
Source
github.com/anfiau/pgelog
pgelog-1.0.2.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
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.