Unix Technical Forum

Monitoring Postgres - Get the SQL queries which are sent to postgres

This is a discussion on Monitoring Postgres - Get the SQL queries which are sent to postgres within the Pgsql General forums, part of the PostgreSQL category; --> Dear list members, I have a web application running that is connected to my postgres database. This web application ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 12:02 PM
Nico Grubert
 
Posts: n/a
Default Monitoring Postgres - Get the SQL queries which are sent to postgres

Dear list members,

I have a web application running that is connected to my postgres
database. This web application builds dynamically SQL queries and
queries the postgres database. I would like to see these SQL queries.
How can I do this? Is there a way to monitor the SQL queries which are
sent to my postgres database?

Thanks in advance,
Nico

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 12:02 PM
Merlin Moncure
 
Posts: n/a
Default Re: Monitoring Postgres - Get the SQL queries which are sent to postgres

On 10/25/06, Nico Grubert <nicogrubert@gmail.com> wrote:
> Dear list members,
>
> I have a web application running that is connected to my postgres
> database. This web application builds dynamically SQL queries and
> queries the postgres database. I would like to see these SQL queries.
> How can I do this? Is there a way to monitor the SQL queries which are
> sent to my postgres database?


see logging features in postgresql.conf. I suggest redirecting stderr
to pg_log and playing with rotation features.

merlin

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 12:02 PM
A. Kretschmer
 
Posts: n/a
Default Re: Monitoring Postgres - Get the SQL queries which are sent to postgres

am Wed, dem 25.10.2006, um 15:56:17 +0200 mailte Nico Grubert folgendes:
> Dear list members,
>
> I have a web application running that is connected to my postgres
> database. This web application builds dynamically SQL queries and
> queries the postgres database. I would like to see these SQL queries.
> How can I do this? Is there a way to monitor the SQL queries which are
> sent to my postgres database?


Set this in your postgresql.conf:

log_statement = all

Reload the server, and then you can find all your statements in the log.


Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:21 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com