Need to trace the logs

Started by nandha kumarover 5 years ago3 messagesgeneral
Jump to latest
#1nandha kumar
bnandhakumardba@gmail.com

Hi Team,
We are using a postgresql database with 9.6.1 version, any way to
trace the last modified object, procedure in PostgreSQL.

Regards,
Nandhakumar B

In reply to: nandha kumar (#1)
Re: Need to trace the logs

On Thu, Oct 15, 2020 at 05:25:11PM +0530, nandha kumar wrote:

Hi Team,
We are using a postgresql database with 9.6.1 version, any way to
trace the last modified object, procedure in PostgreSQL.

well, you can log all queries, and extract the info from logs.

If by "object" you mean table/row - you can do it with triggers.

Best regards,

depesz

#3Pavel Stehule
pavel.stehule@gmail.com
In reply to: hubert depesz lubaczewski (#2)
Re: Need to trace the logs

čt 15. 10. 2020 v 15:51 odesílatel hubert depesz lubaczewski <
depesz@depesz.com> napsal:

On Thu, Oct 15, 2020 at 05:25:11PM +0530, nandha kumar wrote:

Hi Team,
We are using a postgresql database with 9.6.1 version, any way to
trace the last modified object, procedure in PostgreSQL.

well, you can log all queries, and extract the info from logs.

If by "object" you mean table/row - you can do it with triggers.

Event triggers are designed for this purpose

https://www.postgresql.org/docs/9.6/event-triggers.html

Regards

Pavel

Show quoted text

Best regards,

depesz