pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Milen A. Radev <milen@radev.net>
Cc: pgsql-admin@postgresql.org, Naomi Walker <nwalker@mhs.mphasis.com>
Subject: Re: Find the Person Connected to a Database
Date: Fri, 26 Oct 2007 19:09:00 -0400
Message-ID: <1065.1193440140@sss.pgh.pa.us> (raw)
In-Reply-To: <fftpbr$pi5$1@ger.gmane.org>
References: <E11307EB-94DF-4CDD-A89D-0C88A84F2B99@bju.edu>
	<26960.1193434395@sss.pgh.pa.us>
	<20071026144005.3aa6cc29@scratch>
	<27413.1193435100@sss.pgh.pa.us>
	<472262A5.2020605@mhs.mphasis.com>
	<fftpbr$pi5$1@ger.gmane.org>

"Milen A. Radev" <milen@radev.net> writes:
> Naomi Walker íàïèñà:
>> I'm trying to drop a database in a postgres 8.1.4 instance (x86 Solaris 
>> 10 OS),  but someone is connected to
>> the database.  What is the best way to find out exactly who is connected?

> select * from pg_stat_activity where datname = <the_db_about_to_be_dropped>;

If that doesn't work because you've got stats collection turned off,
"ps" will help too:

http://www.postgresql.org/docs/8.1/static/monitoring.html

On Solaris, note the Tip at the bottom (not sure if it applies to recent
Solaris versions but a few years ago it was critical).

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <1065.1193440140@sss.pgh.pa.us>
Permalink:  ../1065.1193440140@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1065.1193440140@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, milen@radev.net, nwalker@mhs.mphasis.com
  Subject: Re: Find the Person Connected to a Database
  In-Reply-To: <1065.1193440140@sss.pgh.pa.us>

* 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