pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedTail -f or watch for postgres
3+ messages / 3 participants
[nested] [flat]
* Tail -f or watch for postgres
@ 2010-04-20 07:20 Renato Oliveira <renato.oliveira@grant.co.uk>
0 siblings, 1 reply; 3+ messages in thread
From: Renato Oliveira @ 2010-04-20 07:20 UTC (permalink / raw)
To: pgsql-admin
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?
Thank you very much
Best regards
Renato
Renato Oliveira
Systems Administrator
e-mail: renato.oliveira@grant.co.uk
Tel: +44 (0)1763 260811
Fax: +44 (0)1763 262410
www.grant.co.uk<http://www.grant.co.uk/;
Grant Instruments (Cambridge) Ltd
Company registered in England, registration number 658133
Registered office address:
29 Station Road,
Shepreth,
CAMBS SG8 6GB
UK
P Please consider the environment before printing this email
CONFIDENTIALITY: The information in this e-mail and any attachments is confidential. It is intended only for the named recipients(s). If you are not the named recipient please notify the sender immediately and do not disclose the contents to another person or take copies.
VIRUSES: The contents of this e-mail or attachment(s) may contain viruses which could damage your own computer system. Whilst Grant Instruments (Cambridge) Ltd has taken every reasonable precaution to minimise this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should therefore carry out your own virus checks before opening the attachment(s).
OpenXML: For information about the OpenXML file format in use within Grant Instruments please visit our website<http://www.grant.co.uk/Support/openxml.html;
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Tail -f or watch for postgres
@ 2010-04-20 10:32 Scott Marlowe <scott.marlowe@gmail.com>
parent: Renato Oliveira <renato.oliveira@grant.co.uk>
0 siblings, 1 reply; 3+ messages in thread
From: Scott Marlowe @ 2010-04-20 10:32 UTC (permalink / raw)
To: Renato Oliveira <renato.oliveira@grant.co.uk>; +Cc: pgsql-admin
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.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Tail -f or watch for postgres
@ 2010-04-20 12:28 Scott Mead <scott.lists@enterprisedb.com>
parent: Scott Marlowe <scott.marlowe@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Scott Mead @ 2010-04-20 12:28 UTC (permalink / raw)
To: Scott Marlowe <scott.marlowe@gmail.com>; +Cc: Renato Oliveira <renato.oliveira@grant.co.uk>; pgsql-admin
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
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2010-04-20 12:28 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-04-20 07:20 Tail -f or watch for postgres Renato Oliveira <renato.oliveira@grant.co.uk>
2010-04-20 10:32 ` Scott Marlowe <scott.marlowe@gmail.com>
2010-04-20 12:28 ` Scott Mead <scott.lists@enterprisedb.com>
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