Re: Logging successful SELECTS?

From: Виктор Егоров <vyegorov(at)gmail(dot)com>
To: Matthew Vernon <matthew(dot)vernon(at)sac(dot)ac(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Logging successful SELECTS?
Date: 2013-01-24 12:48:26
Message-ID: CAGnEbogMzfkpdCDRJXr1nT1OdM8z9FgDjSTa_qTC1x-yoSsfDA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2013/1/24 Matthew Vernon <matthew(dot)vernon(at)sac(dot)ac(dot)uk>:
> I can get postgres to log unsuccessful queries, including the user who
> wrote them, but I'm missing how to get postgres to log the successful
> queries too (I don't need a store of the answer, just the query
> itself). How do I do this?

You can use either log_min_duration_statement or log_statement.
http://www.postgresql.org/docs/current/interactive/runtime-config-logging.html

I would recommend using the first one, logging all statements that took longer
then, say, 300ms. Otherwise logs might become too huge to manage.

--
Victor Y. Yegorov

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2013-01-24 12:57:16 Re: Logging successful SELECTS?
Previous Message Moshe Jacobson 2013-01-24 12:47:49 Re: Optimizing select count query which often takes over 10 seconds