pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: reina@nsi.edu
To: pgsql-admin@postgresql.org
Subject: Determining which users are logged onto the db
Date: 12 Jul 2001 17:16:42 -0700
Message-ID: <f40d3195.0107121616.13a0a9fb@posting.google.com> (raw)

I have a few shell scripts that run when I log into the Postgres
administrator account on my db (i.e. user = 'postgres'). I'd like to
find a simple way to also list from the shell script which users are
currently querying the db.

I know I can see the db backends by using:

 database > ps ax | grep post

 1215 ?        S      0:00 /database/local/pgsql/bin/postmaster -D
/database/loc
 1381 pts/0    S      0:00 login -- postgres           
 1412 ?        S      0:00 postgres: reina db01 xxx.xxx.xxx.xxx idle 
 1413 ?        S      0:00 postgres: abs db01 xxx.xxx.xxx.xxx idle 
 1414 ?        S      0:00 postgres: reina db01 xxx.xxx.xxx.xxx idle 

Is there a way that I can parse out the user names 'reina' and 'abs'?
Perhaps a sed command?

-Tony



Message-ID: <f40d3195.0107121616.13a0a9fb@posting.google.com>
Permalink:  ../f40d3195.0107121616.13a0a9fb@posting.google.com/
Also on:    postgresql.org/message-id/f40d3195.0107121616.13a0a9fb@posting.google.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: reina@nsi.edu
  Subject: Re: Determining which users are logged onto the db
  In-Reply-To: <f40d3195.0107121616.13a0a9fb@posting.google.com>
  References: <f40d3195.0107121616.13a0a9fb@posting.google.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