pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Perrin <clists@perrin.socsci.unc.edu>
To: Matthew Pinhorn <matthew.pinhorn@iona.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Tracing used SQL statments
Date: Wed, 25 Jun 2003 13:58:38 -0400 (EDT)
Message-ID: <Pine.LNX.4.53.0306251357310.19377@perrin.socsci.unc.edu> (raw)
In-Reply-To: <20030625152610.B28118@iona.com>
References: <20030625152610.B28118@iona.com>

In your postgresql.conf file (on my system this is /etc/postgresql.conf -
don't know how standard that is) insert the following line:

debug_print_query = on

then restart the postmaster (again, on my system: /etc/init.d/postgresql
restart) and you'll be on your way. It ends up in the general
postgres.log, /var/log/postgres.log on my system.

ap

----------------------------------------------------------------------
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
clists@perrin.socsci.unc.edu * andrew_perrin (at) unc.edu


On Wed, 25 Jun 2003, 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
>
> --
> Matthew Pinhorn		                 E-Mail: mailto:matthew.pinhorn@iona.com
> IONA                                     WWW:    http://www.orbacus.com
> Making Software Work Together (tm)       Phone:  (709) 738-3725 x 10
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>                http://archives.postgresql.org
>



view thread (3+ messages)  latest in thread

Message-ID: <Pine.LNX.4.53.0306251357310.19377@perrin.socsci.unc.edu>
Permalink:  ../Pine.LNX.4.53.0306251357310.19377@perrin.socsci.unc.edu/
Also on:    postgresql.org/message-id/Pine.LNX.4.53.0306251357310.19377@perrin.socsci.unc.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: clists@perrin.socsci.unc.edu, matthew.pinhorn@iona.com
  Subject: Re: Tracing used SQL statments
  In-Reply-To: <Pine.LNX.4.53.0306251357310.19377@perrin.socsci.unc.edu>
  References: <20030625152610.B28118@iona.com> <Pine.LNX.4.53.0306251357310.19377@perrin.socsci.unc.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