pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedFind the Person Connected to a Database
4+ messages / 3 participants
[nested] [flat]
* Find the Person Connected to a Database
@ 2007-10-26 21:56 Naomi Walker <nwalker@mhs.mphasis.com>
0 siblings, 1 reply; 4+ messages in thread
From: Naomi Walker @ 2007-10-26 21:56 UTC (permalink / raw)
To: ; +Cc: pgsql-admin
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?
Thanks,
Naomi
--
------------------------------------------------------------------------
Naomi Walker Chief Information Officer
Mphasis Healthcare Solutions nwalker@mhs.mphasis.com
---An EDS Company 602-604-3100
------------------------------------------------------------------------
"Intellectuals solve problems; geniuses prevent them."
-- Albert Einstein
------------------------------------------------------------------------
-- CONFIDENTIALITY NOTICE --
Information transmitted by this e-mail is proprietary to MphasiS and/or its Customers and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this e-mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at mailmaster@mphasis.com and delete this mail from your records.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Find the Person Connected to a Database
@ 2007-10-26 22:22 Milen A. Radev <milen@radev.net>
parent: Naomi Walker <nwalker@mhs.mphasis.com>
0 siblings, 1 reply; 4+ messages in thread
From: Milen A. Radev @ 2007-10-26 22:22 UTC (permalink / raw)
To: pgsql-admin
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>;
More here -
http://www.postgresql.org/docs/8.1/static/monitoring-stats.html#MONITORING-STATS-VIEWS.
--
Milen A. Radev
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Find the Person Connected to a Database
@ 2007-10-26 23:09 Tom Lane <tgl@sss.pgh.pa.us>
parent: Milen A. Radev <milen@radev.net>
0 siblings, 1 reply; 4+ messages in thread
From: Tom Lane @ 2007-10-26 23:09 UTC (permalink / raw)
To: Milen A. Radev <milen@radev.net>; +Cc: pgsql-admin@postgresql.org, Naomi Walker <nwalker@mhs.mphasis.com>
"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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Find the Person Connected to a Database
@ 2007-10-26 23:17 Naomi Walker <nwalker@mhs.mphasis.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 4+ messages in thread
From: Naomi Walker @ 2007-10-26 23:17 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Milen A. Radev <milen@radev.net>; pgsql-admin
Thanks for jogging my memory! Works like a charm.
Naomi
>> 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
>
--
------------------------------------------------------------------------
Naomi Walker Chief Information Officer
Mphasis Healthcare Solutions nwalker@mhs.mphasis.com
---An EDS Company 602-604-3100
------------------------------------------------------------------------
"Intellectuals solve problems; geniuses prevent them."
-- Albert Einstein
------------------------------------------------------------------------
-- CONFIDENTIALITY NOTICE --
Information transmitted by this e-mail is proprietary to MphasiS and/or its Customers and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this e-mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at mailmaster@mphasis.com and delete this mail from your records.
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2007-10-26 23:17 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-10-26 21:56 Find the Person Connected to a Database Naomi Walker <nwalker@mhs.mphasis.com>
2007-10-26 22:22 ` Milen A. Radev <milen@radev.net>
2007-10-26 23:09 ` Tom Lane <tgl@sss.pgh.pa.us>
2007-10-26 23:17 ` Naomi Walker <nwalker@mhs.mphasis.com>
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