Thread

  1. Postgresql Logging

    Ericson Smith <eric@did-it.com> — 2004-05-26T18:30:26Z

    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   |
    | eric@did-it.com       | RAM should go to everyone! |
    | 516-255-0500          |             - Sascga Segan |
    +-----------------------+----------------------------+ 
    
    
  2. Re: Postgresql Logging

    Bruce Momjian <pgman@candle.pha.pa.us> — 2004-05-26T18:46:01Z

    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
      pgman@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
    
    
  3. Re: Postgresql Logging

    Ericson Smith <eric@did-it.com> — 2004-05-26T19:59:42Z

    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.
    >
    >  
    >