Re: monitoring sql queries - Mailing list pgsql-general

From J.V.
Subject Re: monitoring sql queries
Date
Msg-id 4EC57D66.6060101@gmail.com
Whole thread Raw
In response to Re: monitoring sql queries  (hubert depesz lubaczewski <depesz@depesz.com>)
Responses Re: monitoring sql queries  (Bill Moran <wmoran@potentialtech.com>)
Re: monitoring sql queries  (Scott Mead <scottm@openscg.com>)
Re: monitoring sql queries  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-general
How is this accomplished?

Is it possible to log queries to a table with additional information?

1) num rows returned (if a select)
2) time to complete the query
3) other info?

How is enabling this actually done?

On 11/17/2011 9:32 AM, hubert depesz lubaczewski wrote:
> On Thu, Nov 17, 2011 at 09:29:11AM -0700, J.V. wrote:
>> I am in need of a tool or method to see each/every SQL query that
>> hits the PostgreSQL database.  By query I mean the query in SQL
>> syntax with all the parameters passed.
>>
>> What I want to do is:
>>      1) see the query
>>      2) Determine how long the query takes to execute
>>      3) Possibly log both of the above to a log file
>>
>> Is there any tool internal to PostgreSQL that would allow me to do this?
>>
>> I cannot monitor it from the code that is actually connecting&
>> sending the query.
>>
>> any help or pointers would be greatly appreciated.
> just enable logging of queries.
>
> Best regards,
>
> depesz
>

pgsql-general by date:

Previous
From: Joseph Shraibman
Date:
Subject: Re: Performance degradation 8.4 -> 9.1
Next
From: "J.V."
Date:
Subject: Re: monitoring sql queries