dbTalk Databases Forums  

logging queries and time used

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss logging queries and time used in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
stig erikson
 
Posts: n/a

Default logging queries and time used - 10-29-2004 , 04:18 PM






Hi.
i would like to log every single query coming in to the database into a
table. i would like the log to include the entire query and execution
time and execution cost, and if possible the user that executed the query.

A trigger is what i was thinking of, but how can i find out the actual
query, the time it took to execute it, etc.?

stig

Reply With Quote
  #2  
Old   
Michael Fuhr
 
Posts: n/a

Default Re: logging queries and time used - 11-01-2004 , 08:59 AM






On Fri, Oct 29, 2004 at 11:18:48PM +0200, stig erikson wrote:

Quote:
i would like to log every single query coming in to the database into a
table. i would like the log to include the entire query and execution
time and execution cost, and if possible the user that executed the query.

A trigger is what i was thinking of, but how can i find out the actual
query, the time it took to execute it, etc.?
See the "Error Reporting and Logging" section of the documentation:

http://www.postgresql.org/docs/7.4/s...CONFIG-LOGGING

You might be able to feed the logging output to a script that inserts
into a table, but make sure that important log messages are also
stored outside the database to avoid losing them if trouble arises.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.