471,075 Members | 1,276 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,075 software developers and data experts.

Postgresql Logging

Hi,

Currently we are logging SQL statements for profiling purposes. We now
get something like this:

2004-05-26 13:27:51 [30017] LOG: statement: SELECT * FROM cache_62
WHERE key='6832271710644150012240e7153b6f62'
2004-05-26 13:27:51 [30017] LOG: duration: 0.733 ms

Is there a way to get the duration into the statement line as well?
Sometimes the logging overlaps, so its difficult to decide which
duration applies to which statement, even though the have the PID in there.

--
Warmest regards,
Ericson Smith
Tracking Specialist/DBA
+-----------------------+----------------------------+
| http://www.did-it.com | RAM is cheap. RAM is fun |
| er**@did-it.com | RAM should go to everyone! |
| 516-255-0500 | - Sascga Segan |
+-----------------------+----------------------------+

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #1
2 1999
Ericson Smith wrote:
Hi,

Currently we are logging SQL statements for profiling purposes. We now
get something like this:

2004-05-26 13:27:51 [30017] LOG: statement: SELECT * FROM cache_62
WHERE key='6832271710644150012240e7153b6f62'
2004-05-26 13:27:51 [30017] LOG: duration: 0.733 ms

Is there a way to get the duration into the statement line as well?
Sometimes the logging overlaps, so its difficult to decide which
duration applies to which statement, even though the have the PID in there.


Sure, set log_min_duration_statement to 0. That is new in 7.4.

--
Bruce Momjian | http://candle.pha.pa.us
pg***@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2
Exactly what I need. Thanks a lot.

- Ericson

Bruce Momjian wrote:
Ericson Smith wrote:

Hi,

Currently we are logging SQL statements for profiling purposes. We now
get something like this:

2004-05-26 13:27:51 [30017] LOG: statement: SELECT * FROM cache_62
WHERE key='6832271710644150012240e7153b6f62'
2004-05-26 13:27:51 [30017] LOG: duration: 0.733 ms

Is there a way to get the duration into the statement line as well?
Sometimes the logging overlaps, so its difficult to decide which
duration applies to which statement, even though the have the PID in there.


Sure, set log_min_duration_statement to 0. That is new in 7.4.

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Errol Neal | last post: by
19 posts views Thread by Alex Madon | last post: by
reply views Thread by Jean-Michel POURE | last post: by
1 post views Thread by phil campaigne | last post: by
2 posts views Thread by Postgresql | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.