X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 2E83E30FC63 for ; Wed, 25 Jun 2003 18:06:17 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 76147-07 for ; Wed, 25 Jun 2003 15:06:06 -0300 (ADT) Received: from tanis.hss.caltech.edu (tanis.hss.caltech.edu [131.215.23.122]) by svr1.postgresql.org (Postfix) with ESMTP id D89A130FC09 for ; Wed, 25 Jun 2003 15:06:05 -0300 (ADT) Received: from hss.caltech.edu (charlie@economex.caltech.edu [131.215.22.66]) by tanis.hss.caltech.edu (8.12.9/8.12.8) with ESMTP id h5PI5s1s008352; Wed, 25 Jun 2003 11:05:54 -0700 (PDT) Message-ID: <3EF9E387.50502@hss.caltech.edu> Date: Wed, 25 Jun 2003 11:01:43 -0700 From: Charles Hornberger User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3.1) Gecko/20030527 Debian/1.3.1-2 X-Accept-Language: en MIME-Version: 1.0 To: Matthew Pinhorn Cc: pgsql-admin@postgresql.org Subject: Re: Tracing used SQL statments References: <20030625152610.B28118@iona.com> In-Reply-To: <20030625152610.B28118@iona.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200306/295 X-Sequence-Number: 9286 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