pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Tracing used SQL statments
3+ messages / 3 participants
[nested] [flat]

* Tracing used SQL statments
@ 2003-06-25 17:56 Matthew Pinhorn <matthew.pinhorn@iona.com>
  2003-06-25 17:58 ` Re: Tracing used SQL statments Andrew Perrin <clists@perrin.socsci.unc.edu>
  2003-06-25 18:01 ` Re: Tracing used SQL statments Charles Hornberger <charlie@hss.caltech.edu>
  0 siblings, 2 replies; 3+ messages in thread

From: Matthew Pinhorn @ 2003-06-25 17:56 UTC (permalink / raw)
  To: pgsql-admin


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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Tracing used SQL statments
  2003-06-25 17:56 Tracing used SQL statments Matthew Pinhorn <matthew.pinhorn@iona.com>
@ 2003-06-25 17:58 ` Andrew Perrin <clists@perrin.socsci.unc.edu>
  1 sibling, 0 replies; 3+ messages in thread

From: Andrew Perrin @ 2003-06-25 17:58 UTC (permalink / raw)
  To: Matthew Pinhorn <matthew.pinhorn@iona.com>; +Cc: pgsql-admin

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
>



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Tracing used SQL statments
  2003-06-25 17:56 Tracing used SQL statments Matthew Pinhorn <matthew.pinhorn@iona.com>
@ 2003-06-25 18:01 ` Charles Hornberger <charlie@hss.caltech.edu>
  1 sibling, 0 replies; 3+ messages in thread

From: Charles Hornberger @ 2003-06-25 18:01 UTC (permalink / raw)
  To: Matthew Pinhorn <matthew.pinhorn@iona.com>; +Cc: 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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2003-06-25 18:01 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-06-25 17:56 Tracing used SQL statments Matthew Pinhorn <matthew.pinhorn@iona.com>
2003-06-25 17:58 ` Andrew Perrin <clists@perrin.socsci.unc.edu>
2003-06-25 18:01 ` Charles Hornberger <charlie@hss.caltech.edu>

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