pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Charles Hornberger <charlie@hss.caltech.edu>
To: Matthew Pinhorn <matthew.pinhorn@iona.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Tracing used SQL statments
Date: Wed, 25 Jun 2003 11:01:43 -0700
Message-ID: <3EF9E387.50502@hss.caltech.edu> (raw)
In-Reply-To: <20030625152610.B28118@iona.com>
References: <20030625152610.B28118@iona.com>

Set

   log_statement = true

in your postgresql.conf file, then stop & restart the postmaster. 
Queries will be printed in the postmaster's output (or via syslog, if 
you're using that).

See 
http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=runtime-config.html#LOGGING 
for details.

-Charlie

Matthew Pinhorn wrote:
> Hello,
> 
> 	I am wondering if somebody can help me. I want to know if there is a
> way that I can make some kind of a log file of all of the SQL statements that
> are used in my database. It was suggested to make that I could make a trace
> of them and I am not sure how to do that.
> 
> 	I have inherited a database from a former co-worker and now I am
> starting to get crashes. The crashes has SET TRANSACTION ISOLATION LEVEL 
> messages in the log file. So I think that there is a lock on the database.
>  And if I can see the queries that are causing the crash I might be able 
> to fix the problem.
> 
> Thanks
> 
> Matthew 
> 

-- 
Charles Hornberger
Caltech
Division of the Humanities and Social Sciences
M/C 228-77
Tel (626) 395-3474




view thread (3+ messages)

Message-ID: <3EF9E387.50502@hss.caltech.edu>
Permalink:  ../3EF9E387.50502@hss.caltech.edu/
Also on:    postgresql.org/message-id/3EF9E387.50502@hss.caltech.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: charlie@hss.caltech.edu, matthew.pinhorn@iona.com
  Subject: Re: Tracing used SQL statments
  In-Reply-To: <3EF9E387.50502@hss.caltech.edu>
  References: <20030625152610.B28118@iona.com> <3EF9E387.50502@hss.caltech.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox