Skip site navigation (1) Skip section navigation (2)

Re: Tracing used SQL statments

From: Charles Hornberger <charlie(at)hss(dot)caltech(dot)edu>
To: Matthew Pinhorn <matthew(dot)pinhorn(at)iona(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Tracing used SQL statments
Date: 2003-06-25 18:01:43
Message-ID: 3EF9E387.50502@hss.caltech.edu (view raw or flat)
Thread:
Lists: pgsql-admin
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


In response to

pgsql-admin by date

Next:From: Bruce YoungDate: 2003-06-25 19:00:27
Subject: contrib/tsearch - chopped words
Previous:From: Andrew PerrinDate: 2003-06-25 17:58:38
Subject: Re: Tracing used SQL statments

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group