The PostgreSQL simple logging extension (pg_sulog
) provides supe ruser role's operation logging for server log.
And super user role's operation blocking.
$ psql -U postgres sampledb -t -c "SELECT 1;"
WARNING: pg_sulog: 2015-11-19 21:51:20 JST [logging] user=postgres SELECT 1
shared_preload_libraries = pg_sulog
- 'BLOCK', super user role's all operation is blocked.
- 'MAINTENANCE', Other than the following commands, super user operation will be blocked.
- VACUUM, REINDEX, ANALYZE, CLUSTER
- 'LOGGING', super user role's all operation is logged.
pg_sulog.block = 'BLOCK' example.
$ psql -U postgres sampledb -t -c "SELECT 3;"
WARNING: pg_sulog: 2015-11-19 22:51:28 JST [blocked] user=postgres SELECT 3;
SELECT 0
$
The default is LOGGING
.
- OS
- CentOS 7
- PostgreSQL
- 9.6-develop (maybe)
- 9.5-beta2
- 9.4
- 9.3
- The maximum number of super user is 64.
- Output format customize.
- Maintenance command custmize.
- Other platform verification.
- Regression test
- Stability verification
- Executor_Run_hook
- ProcessUtility_hook
@nuko_yokohama (https://twitter.com/nuko_yokohama)