Thread: Table/log file name which store the queries which got executed inlast 1 month

Hi All,

In our production environment data in some of the table has been updated from the back end by some user. The update is very random, is there any table which stores the details of queries got executed in last one month or so.

Regards,

Gaurav

+91 876 265 4621



On Apr 30, 2020, at 9:19 PM, Gaurav Tomar <gauravtomar14@gmail.com> wrote:

Hi All,

In our production environment data in some of the table has been updated from the back end by some user. The update is very random, is there any table which stores the details of queries got executed in last one month or so.

Regards,

Gaurav

+91 876 265 4621

No.
Depending on the system configurations settings such as ‘log_statement there may be useful information in the postgres server logs.
Current version of these settings are described here: https://www.postgresql.org/docs/12/runtime-config-logging.html

Re: Table/log file name which store the queries which got executed inlast 1 month

From
Rene Romero Benavides
Date:
Another option is making use of this trigger in such table https://wiki.postgresql.org/wiki/Audit_trigger , but I would go with logging if the table is very transactional, as suggested by Rob Sargent.  




On Thu, Apr 30, 2020 at 10:20 PM Gaurav Tomar <gauravtomar14@gmail.com> wrote:
Hi All,

In our production environment data in some of the table has been updated from the back end by some user. The update is very random, is there any table which stores the details of queries got executed in last one month or so.

Regards,

Gaurav

+91 876 265 4621



--
El genio es 1% inspiración y 99% transpiración.
Thomas Alva Edison
http://pglearn.blogspot.mx/

If thoses users are connected with distinct accounts from application into
the database, maybe that pg_stat_statements may help see
https://www.postgresql.org/docs/current/pgstatstatements.html

Regards
PAscal




--
Sent from: https://www.postgresql-archive.org/PostgreSQL-sql-f2142323.html



Going forward you might consider enabling  the parameter 

track_commit_timestamp

This would allow you to view the latest transaction commit times for rows in a table, but be aware that there will be some performance overhead by enabling this. 

Regards,

Craig

On Fri, May 1, 2020 at 1:55 AM legrand legrand <legrand_legrand@hotmail.com> wrote:
If thoses users are connected with distinct accounts from application into
the database, maybe that pg_stat_statements may help see
https://www.postgresql.org/docs/current/pgstatstatements.html

Regards
PAscal




--
Sent from: https://www.postgresql-archive.org/PostgreSQL-sql-f2142323.html




--
Craig