pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Mead <scott.lists@enterprisedb.com>
To: Scott Marlowe <scott.marlowe@gmail.com>
Cc: Renato Oliveira <renato.oliveira@grant.co.uk>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Tail -f or watch for postgres
Date: Tue, 20 Apr 2010 08:28:08 -0400
Message-ID: <z2od3ab2ec81004200528l49aac38fj45a9612e2ab662b@mail.gmail.com> (raw)
In-Reply-To: <j2wdcc563d11004200332hf17ead27l8c21f8b3aaf17c12@mail.gmail.com>
References: <7965A9DCF12CC14984420BCC37B1608F25AC0B9EF1@Elzar.grant.co.uk>
	<j2wdcc563d11004200332hf17ead27l8c21f8b3aaf17c12@mail.gmail.com>

On Tue, Apr 20, 2010 at 6:32 AM, Scott Marlowe <scott.marlowe@gmail.com>wrote:

> On Tue, Apr 20, 2010 at 1:20 AM, Renato Oliveira
> <renato.oliveira@grant.co.uk> wrote:
> > Dear all,
> >
> > It may sounds crazy it may not sound so crazy.
> >
> > I was here think are there any commands to watch new transactions rolling
> > through the screen like a terminal monitor?
> >
> > For example, if you want to watch a log file you can execute the command;
> > tail –f <logfile> or watch.
> >
> > This will keep the log entries rolling and being displayed on screen.
> >
> > Is there something similar to postgreSQL?
>
> while true; do psql mydb -c "select * from pg_stat_activity where
> current_query <>'<IDLE>'";sleep 10;done
>
> or something like that.
>

That's a good one --

  You could also set 'log_min_duration_statement = 1000 '

    (This logs all statements taking 1 second or more into the logfile),
then do a 'tail -f ' on the latest log in the pg_log folder.   The lower you
set log_min_duration_statement, the more overhead you place on your database
(this could be significant, so be careful).

--Scott


>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

view thread (3+ messages)

Message-ID: <z2od3ab2ec81004200528l49aac38fj45a9612e2ab662b@mail.gmail.com>
Permalink:  ../z2od3ab2ec81004200528l49aac38fj45a9612e2ab662b@mail.gmail.com/
Also on:    postgresql.org/message-id/z2od3ab2ec81004200528l49aac38fj45a9612e2ab662b@mail.gmail.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: scott.lists@enterprisedb.com, scott.marlowe@gmail.com, renato.oliveira@grant.co.uk
  Subject: Re: Tail -f or watch for postgres
  In-Reply-To: <z2od3ab2ec81004200528l49aac38fj45a9612e2ab662b@mail.gmail.com>

* 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