Re: Number of Connections

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Number of Connections
Date: 2001-02-16 21:23:57
Message-ID: 13807.982358637@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Neil Conway <nconway(at)klamath(dot)dyndns(dot)org> writes:
> On Fri, Feb 16, 2001 at 02:09:42PM -0500, Bryan White wrote:
>> ps ax | grep postgres | wc -l
>> Note the value is often one to high because is picks up the grep process.

> Why not just remove 'grep' - i.e
> ps ax | grep postgres | grep -v grep | wc -l

Actually this is a standard problem with a standard solution: use a
not-so-literal grep pattern, eg

ps ax | grep '[p]ostgres' | wc -l

This pattern matches 'postgres' but not '[p]ostgres'. Problem solved.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Leon Sol Levy 2001-02-16 21:40:30 Re: creating assertions in functions
Previous Message Mitch Vincent 2001-02-16 21:12:04 Re: order of clauses