Thread: Postgres Table level statement logging

Postgres Table level statement logging

From
Madhu S R
Date:
Hi,

I need to log the statements executed for a list of tables. It will be Data Modification statements like INSERT/UPDATE/DELETE on any of these tables. Please let me know if this is possible in postgres logging.

Regards,
Madhu

Re: Postgres Table level statement logging

From
Vibhor Kumar
Date:
On Feb 7, 2012, at 5:42 AM, Madhu S R wrote:

> I need to log the statements executed for a list of tables. It will be Data Modification statements like
INSERT/UPDATE/DELETEon any of these tables. Please let me know if this is possible in postgres logging. 

Yes, this possible. You can set log_statement parameter.
http://www.postgresql.org/docs/current/static/runtime-config-logging.html#GUC-LOG-STATEMENT


Thanks & Regards,
Vibhor Kumar
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
Blog: http://vibhork.blogspot.com


Re: Postgres Table level statement logging

From
Andreas Kretschmer
Date:
Madhu S R <s_r_madhu@yahoo.co.in> wrote:

> Hi,
>
> I need to log the statements executed for a list of tables. It will be Data
> Modification statements like INSERT/UPDATE/DELETE on any of these tables.
> Please let me know if this is possible in postgres logging.

http://andreas.scherbaum.la/blog/archives/100-Log-Table-Changes-in-PostgreSQL-with-tablelog.html

Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

Log statement with timestamp

From
Madhu S R
Date:
Hi,

    I need to log DDL or MOD statements with current time when the statement executed. Please let me know if this is possible.

Regards,
Madhu

Re: Log statement with timestamp

From
Raghavendra
Date:
Need to enable log_line_prefix with timestamp "%t".
http://www.postgresql.org/docs/9.1/static/runtime-config-logging.html 

---
Regards,
Raghavendra
EnterpriseDB Corporation



On Thu, Feb 23, 2012 at 2:15 PM, Madhu S R <s_r_madhu@yahoo.co.in> wrote:
Hi,

    I need to log DDL or MOD statements with current time when the statement executed. Please let me know if this is possible.

Regards,
Madhu