agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
Table/log file name which store the queries which got executed in last 1 month
5+ messages / 5 participants
[nested] [flat]

* Table/log file name which store the queries which got executed in last 1 month
@ 2020-05-01 03:19  Gaurav Tomar <gauravtomar14@gmail.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Gaurav Tomar @ 2020-05-01 03:19 UTC (permalink / raw)
  To: pgsql-sql

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

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Table/log file name which store the queries which got executed in last 1 month
@ 2020-05-01 03:33  Rob Sargent <robjsargent@gmail.com>
  parent: Gaurav Tomar <gauravtomar14@gmail.com>
  1 sibling, 0 replies; 5+ messages in thread

From: Rob Sargent @ 2020-05-01 03:33 UTC (permalink / raw)
  To: Gaurav Tomar <gauravtomar14@gmail.com>; +Cc: pgsql-sql



> 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 <https://www.postgresql.org/docs/12/runtime-config-logging.html>=

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Table/log file name which store the queries which got executed in last 1 month
@ 2020-05-01 03:34  Rene Romero Benavides <rene.romero.b@gmail.com>
  parent: Gaurav Tomar <gauravtomar14@gmail.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Rene Romero Benavides @ 2020-05-01 03:34 UTC (permalink / raw)
  To: Gaurav Tomar <gauravtomar14@gmail.com>; +Cc: pgsql-sql

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/

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Table/log file name which store the queries which got executed in last 1 month
@ 2020-05-01 07:55  legrand legrand <legrand_legrand@hotmail.com>
  parent: Rene Romero Benavides <rene.romero.b@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: legrand legrand @ 2020-05-01 07:55 UTC (permalink / raw)
  To: pgsql-sql

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





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Table/log file name which store the queries which got executed in last 1 month
@ 2020-05-04 15:36  Craig Jackson <craig.jackson@broadcom.com>
  parent: legrand legrand <legrand_legrand@hotmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Craig Jackson @ 2020-05-04 15:36 UTC (permalink / raw)
  To: legrand legrand <legrand_legrand@hotmail.com>; +Cc: pgsql-sql

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

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2020-05-04 15:36 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-05-01 03:19 Table/log file name which store the queries which got executed in last 1 month Gaurav Tomar <gauravtomar14@gmail.com>
2020-05-01 03:33 ` Rob Sargent <robjsargent@gmail.com>
2020-05-01 03:34 ` Rene Romero Benavides <rene.romero.b@gmail.com>
2020-05-01 07:55   ` legrand legrand <legrand_legrand@hotmail.com>
2020-05-04 15:36     ` Craig Jackson <craig.jackson@broadcom.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox