gleu / pg_log_userqueries Goto Github PK
View Code? Open in Web Editor NEWModule to log queries done by specific user types
License: ISC License
Module to log queries done by specific user types
License: ISC License
The title says it all. It would be interesting to be able to send the logs directly to a remote server, as this extension is interesting for forensics.
The current version allows to filter queries by, for example, username.
It might be useful to filter using negations, in this case since users can be added to the database at anytime.
Updating the filter each time is cumbersome and error prone.
A second argument is that, regex.h doesn't support look ahead / look behind.
The only way is to use this kind of horror : "^([^m])|(m[^a])|(ma[^c])" to filter out "mac".
When pg_log_userqueries.log_superusers = on
the extension log queries executed by bgworkers like powa with a trace like:
2017-12-20 09:19:13 CET [5956]: [4098802-1] user=,db=,client= LOG: USERQUERIES SELECT powa_take_snapshot()
I guess that pg_log_userqueries might not log queries when the user or db is not set.
You might need to add the following line at top of pg_log_userqueries.c
#include <time.h>
Regards
pg_log_userqueries use log level NOTICE by default, that mean that if you don't set log_min_message to notice nothing will be logged. You either need to change this default log level or write some information about that in documentation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.