Tail -f or watch for postgres

--_000_7965A9DCF12CC14984420BCC37B1608F25AC0B9EF1Elzargrantc ou_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

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 t=
hrough the screen like a terminal monitor?

For example, if you want to watch a log file you can execute the command; t=
ail -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 [at] 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 conf=
idential. It is intended only for the named recipients(s). If you are not t=
he 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 w=
hich could damage your own computer system. Whilst Grant Instruments (Cambr=
idge) Ltd has taken every reasonable precaution to minimise this risk, we c=
annot accept liability for any damage which you sustain as a result of soft=
ware viruses. You should therefore carry out your own virus checks before o=
pening 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>

--_000_7965A9DCF12CC14984420BCC37B1608F25AC0B9EF1Elzargrantc ou_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<HTML xmlns=3D"http://www.w3.org/TR/REC-html40" xmlns:m=3D"http://schemas.m=
icrosoft.com/office/2004/12/omml" xmlns:o=3D"urn:schemas-microsoft-com:offi=
ce:office" xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:w=3D"urn:schemas=
-microsoft-com:office:word"><head><META content=3D"text/html; charset=3Dus-=
ascii" http-equiv=3D"Content-Type">
<META content=3D"text/html; charset=3Dus-ascii" http-equiv=3D"Content-Type"=
>

<meta content=3D"text/html; charset=3Dus-ascii" http-equiv=3DContent-Type>
<meta content=3D"Microsoft Word 12 (filtered medium)" name=3DGenerator>
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
..MsoChpDefault
{mso-style-type:export-only;}
[at] page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head><BODY>
<DIV STYLE=3D"FONT-SIZE: 9pt; FONT-FAMILY: Courier New">
<DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2">

<div class=3DSection1>

<p class=3DMsoNormal>Dear all,<o:p></o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>It may sounds crazy it may not sound so crazy.<o:p></o=
:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>I was here think are there any commands to watch new
transactions rolling through the screen like a terminal monitor?<o:p></o:p>=
</p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>For example, if you want to watch a log file you can e=
xecute
the command; tail –f <logfile> or watch.<o:p></o:p></p>

<p class=3DMsoNormal>This will keep the log entries rolling and being displ=
ayed
on screen.<o:p></o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>Is there something similar to postgreSQL?<o:p></o:p></=
p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>Thank you very much<o:p></o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>Best regards<o:p></o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>Renato<o:p></o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

</div>

</FONT></DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"></FONT> </DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"><FONT FACE=3D"Arial" SIZE=3D"2">Renato=
Oliveira<BR>Systems Administrator<BR>e-mail: renato.oliveira [at] grant.co.uk</=
FONT></FONT><FONT FACE=3D"Arial" SIZE=3D"2"><FONT FACE=3D"Arial" SIZE=3D"2"=
></FONT></FONT></DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"><FONT FACE=3D"Arial" SIZE=3D"2"></FONT=
></FONT> </DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"><FONT FACE=3D"Arial" SIZE=3D"2">Tel: +=
44 (0)1763 260811<BR>Fax: +44 (0)1763 262410<BR><A HREF=3D"http://www.grant=
..co.uk/">www.grant.co.uk</A></FONT></FONT></DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"><FONT FACE=3D"Arial" SIZE=3D"2"></FONT=
></FONT> </DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"><FONT FACE=3D"Arial" SIZE=3D"2">Grant =
Instruments (Cambridge) Ltd <BR> <BR>Company registered in England, re=
gistration number 658133<BR> <BR>Registered office address:<BR>29 Stat=
ion Road, <BR>Shepreth, <BR>CAMBS SG8 6GB <BR>UK</FONT></FONT></DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"><FONT FACE=3D"Arial" SIZE=3D"2"></FONT=
></FONT><FONT FACE=3D"Arial" SIZE=3D"2"><FONT FACE=3D"Arial" SIZE=3D"2"></F=
ONT></FONT> </DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"><FONT FACE=3D"Arial" SIZE=3D"2"></FONT=
></FONT></DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"><FONT FACE=3D"Arial" SIZE=3D"2"></FONT=
></FONT> </DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"><FONT FACE=3D"Arial" SIZE=3D"2"></FONT=
></FONT></DIV>
<DIV> </DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"><FONT FACE=3D"Arial" SIZE=3D"2"></FONT=
></FONT></DIV>
<DIV> </DIV> </DIV>
<DIV>
<P CLASS=3D"MsoNormal"><EM><B><SPAN LANG=3D"EN-US" STYLE=3D"FONT-SIZE: 18pt=
; COLOR: green; FONT-FAMILY: Webdings"></SPAN></B></EM> </P>
<P CLASS=3D"MsoNormal"><EM><B><SPAN LANG=3D"EN-US" STYLE=3D"FONT-SIZE: 18pt=
; COLOR: green; FONT-FAMILY: Webdings">P</SPAN></B></EM><EM><B><SPAN LANG=
=3D"EN-US" STYLE=3D"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','=
sans-serif'"> </SPAN></B></EM><STRONG><I><SPAN STYLE=3D"FONT-SIZE: 7.5pt; C=
OLOR: green; FONT-FAMILY: 'Arial','sans-serif'">Please consider the environ=
ment before printing this email</SPAN></I></STRONG></P></DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"><STRONG>CONFIDENTIALITY</STRONG>: The =
information in this e-mail and any attachments is confidential. It is inten=
ded only for the named recipients(s). If you are not the named recipient pl=
ease notify the sender immediately and do not disclose the contents to anot=
her person or take copies. </FONT></DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"></FONT> </DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"><STRONG></STRONG></FONT></DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"><STRONG>VIRUSES:</STRONG> The contents=
of this e-mail or attachment(s) may contain viruses which could damage you=
r own computer system. Whilst Grant Instruments (Cambridge) Ltd has taken e=
very reasonable precaution to minimise this risk, we cannot accept liabilit=
y for any damage which you sustain as a result of software viruses. You sho=
uld therefore carry out your own virus checks before opening the attachment=
(s).</FONT></DIV>
<DIV> </DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"></FONT></DIV>
<DIV><FONT FACE=3D"Arial" SIZE=3D"2"><STRONG>OpenXML</STRONG>: For informat=
ion about the OpenXML file format in use within Grant Instruments please vi=
sit our <A HREF=3D"http://www.grant.co.uk/Support/openxml.html">website</A>=
</FONT></DIV></DIV></BODY></HTML>

--_000_7965A9DCF12CC14984420BCC37B1608F25AC0B9EF1Elzargrantc ou_--
Renato Oliveira [ Di, 20 April 2010 09:20 ] [ ID #2039495 ]

Re: Tail -f or watch for postgres

On Tue, Apr 20, 2010 at 1:20 AM, Renato Oliveira
<renato.oliveira [at] 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 =96f <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.

--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Scott Marlowe [ Di, 20 April 2010 12:32 ] [ ID #2039496 ]

Re: Tail -f or watch for postgres

--00151747c002c44a430484aa3585
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

On Tue, Apr 20, 2010 at 6:32 AM, Scott Marlowe <scott.marlowe [at] gmail.com>wro=
te:

> On Tue, Apr 20, 2010 at 1:20 AM, Renato Oliveira
> <renato.oliveira [at] 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 rolli=
ng
> > through the screen like a terminal monitor?
> >
> > For example, if you want to watch a log file you can execute the comman=
d;
> > tail =96f <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 =3D 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 yo=
u
set log_min_duration_statement, the more overhead you place on your databas=
e
(this could be significant, so be careful).

--Scott


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

--00151747c002c44a430484aa3585
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

<br><div class=3D"gmail_quote">On Tue, Apr 20, 2010 at 6:32 AM, Scott Marlo=
we <span dir=3D"ltr"><<a href=3D"mailto:scott.marlowe [at] gmail.com">scott.m=
arlowe [at] gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote"=
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class=3D"im">On Tue, Apr 20, 2010 at 1:20 AM, Renato Oliveira<br>
<<a href=3D"mailto:renato.oliveira [at] grant.co.uk">renato.oliveira [at] grant.co=
..uk</a>> wrote:<br>
> Dear all,<br>
><br>
> It may sounds crazy it may not sound so crazy.<br>
><br>
> I was here think are there any commands to watch new transactions roll=
ing<br>
> through the screen like a terminal monitor?<br>
><br>
> For example, if you want to watch a log file you can execute the comma=
nd;<br>
> tail =96f <logfile> or watch.<br>
><br>
> This will keep the log entries rolling and being displayed on screen.<=
br>
><br>
> Is there something similar to postgreSQL?<br>
<br>
</div>while true; do psql mydb -c "select * from pg_stat_activity wher=
e<br>
current_query <>'<IDLE>'";sleep 10;done<br>
<br>
or something like that.<br></blockquote><div><br></div><div>That's a go=
od one --=A0</div><div><br></div><div>=A0=A0You could also set 'log_min=
_duration_statement =3D 1000 '</div><div><br></div><div>=A0=A0 =A0(This=
logs all statements taking 1 second or more into the logfile), then do a &=
#39;tail -f ' on the latest log in the pg_log folder. =A0 The lower you=
set log_min_duration_statement, the more overhead you place on your databa=
se (this could be significant, so be careful).</div>
<div><br></div><div>--Scott=A0</div><div>=A0</div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left=
:1ex;">
<br>
--<br>
Sent via pgsql-admin mailing list (<a href=3D"mailto:pgsql-admin [at] postgresql=
..org">pgsql-admin [at] postgresql.org</a>)<br>
<div class=3D"im">To make changes to your subscription:<br>
</div><a href=3D"http://www.postgresql.org/mailpref/pgsql-admin" target=3D"=
_blank">http://www.postgresql.org/mailpref/pgsql-admin</a><br>
</blockquote></div><br>

--00151747c002c44a430484aa3585--
Scott Mead [ Di, 20 April 2010 14:28 ] [ ID #2039497 ]
Datenbanken » gmane.comp.db.postgresql.admin » Tail -f or watch for postgres

Vorheriges Thema: Vacuum Full (PG 8.1) - Urgent help needed - Cancel & transaction"liberation"
Nächstes Thema: archived WALL files question