Thread: active connections

active connections

From
João Paulo Zavanela
Date:
Hi,

I would like to know how many active connections exist.
Is necessary show the number ip of client.

Please, somebody knows?

Thanks!



Re: active connections

From
"A. Kretschmer"
Date:
am  Tue, dem 30.10.2007, um 14:51:33 -0300 mailte João Paulo Zavanela folgendes:
> Hi,
>
> I would like to know how many active connections exist.
> Is necessary show the number ip of client.

ask pg_stat_activity

(select * from pg_stat_activity;)

Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

Re: active connections

From
João Paulo Zavanela
Date:
I don't understand, where I do it?


>-- Mensagem Original --
>From: "Martin Gainty" <mgainty@hotmail.com>
>To: João Paulo Zavanela <joao_zava@globo.com>
>Subject: Re: [GENERAL] active connections
>Date: Mon, 30 Oct 2000 16:51:30 -0500
>
>
>ps aux | grep postgres
>
>M--
>----- Original Message -----
>From: "João Paulo Zavanela" <joao_zava@globo.com>
>To: <pgsql-general@postgresql.org>
>Sent: Tuesday, October 30, 2007 12:51 PM
>Subject: [GENERAL] active connections
>
>
>Hi,
>
>I would like to know how many active connections exist.
>Is necessary show the number ip of client.
>
>Please, somebody knows?
>
>Thanks!
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: Have you checked our extensive FAQ?
>
>               http://www.postgresql.org/docs/faq
>



Re: active connections

From
Andreas Kretschmer
Date:
João Paulo Zavanela <joao_zava@globo.com> schrieb:

> I don't understand, where I do it?

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Please no top-posting, it's hard to read.

> >
> >
> >ps aux | grep postgres

You mean this? Okay, type it on the command-line on the db-server.
I assume it's a *NIX-like machine, no Windoze.


> >I would like to know how many active connections exist.
> >Is necessary show the number ip of client.

the more db-like solution, as i said, ask the system-view
pg_stat_activity


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."    (unknow)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°