pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
I want to find out who is using a database
5+ messages / 3 participants
[nested] [flat]

* I want to find out who is using a database
@ 2010-11-10 02:17  Tena Sakai <tsakai@gallo.ucsf.edu>
  0 siblings, 2 replies; 5+ messages in thread

From: Tena Sakai @ 2010-11-10 02:17 UTC (permalink / raw)
  To: pgsql-admin

Hi Everybody,

I want to drop a database and recreate it from a backup file.
But when I issue a dropdb command it wouldn’t let me do
so.  It tells me: database xxxxx is being accessed by other
users.

Can somebody please tell me how I find who it is using the
xxxxx database?

Thank you.

Regards,

Tena Sakai
tsakai@gallo.ucsf.edu

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: I want to find out who is using a database
@ 2010-11-10 02:25  Samuel Stearns <SStearns@internode.com.au>
  parent: Tena Sakai <tsakai@gallo.ucsf.edu>
  1 sibling, 1 reply; 5+ messages in thread

From: Samuel Stearns @ 2010-11-10 02:25 UTC (permalink / raw)
  To: Tena Sakai <tsakai@gallo.ucsf.edu>; pgsql-admin

Psql template1

Select * from pg_stat_activity;

Sam

From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Tena Sakai
Sent: Wednesday, 10 November 2010 12:48 PM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] I want to find out who is using a database

Hi Everybody,

I want to drop a database and recreate it from a backup file.
But when I issue a dropdb command it wouldn't let me do
so.  It tells me: database xxxxx is being accessed by other
users.

Can somebody please tell me how I find who it is using the
xxxxx database?

Thank you.

Regards,

Tena Sakai
tsakai@gallo.ucsf.edu

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: I want to find out who is using a database
@ 2010-11-10 02:26  Shoaib Mir <shoaibmir@gmail.com>
  parent: Tena Sakai <tsakai@gallo.ucsf.edu>
  1 sibling, 1 reply; 5+ messages in thread

From: Shoaib Mir @ 2010-11-10 02:26 UTC (permalink / raw)
  To: Tena Sakai <tsakai@gallo.ucsf.edu>; +Cc: pgsql-admin

On Wed, Nov 10, 2010 at 1:17 PM, Tena Sakai <tsakai@gallo.ucsf.edu> wrote:

>
> Can somebody please tell me how I find who it is using the
> xxxxx database?
>
>
select * from pg_stat_activity where datname = '<yourdbname>';

-- 
Shoaib Mir
http://shoaibmir.wordpress.com/

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: I want to find out who is using a database
@ 2010-11-10 02:31  Tena Sakai <tsakai@gallo.ucsf.edu>
  parent: Samuel Stearns <SStearns@internode.com.au>
  0 siblings, 0 replies; 5+ messages in thread

From: Tena Sakai @ 2010-11-10 02:31 UTC (permalink / raw)
  To: Samuel Stearns <SStearns@internode.com.au>; pgsql-admin

Thank you, Sam.

Tena


On 11/9/10 6:25 PM, "Samuel Stearns" <SStearns@internode.com.au> wrote:

Psql template1

Select * from pg_stat_activity;

Sam


From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Tena Sakai
Sent: Wednesday, 10 November 2010 12:48 PM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] I want to find out who is using a database

Hi Everybody,

I want to drop a database and recreate it from a backup file.
But when I issue a dropdb command it wouldn’t let me do
so.  It tells me: database xxxxx is being accessed by other
users.

Can somebody please tell me how I find who it is using the
xxxxx database?

Thank you.

Regards,

Tena Sakai
tsakai@gallo.ucsf.edu

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: I want to find out who is using a database
@ 2010-11-10 02:32  Tena Sakai <tsakai@gallo.ucsf.edu>
  parent: Shoaib Mir <shoaibmir@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Tena Sakai @ 2010-11-10 02:32 UTC (permalink / raw)
  To: Shoaib Mir <shoaibmir@gmail.com>; +Cc: pgsql-admin

Thank you, Shoaib.

Tena


On 11/9/10 6:26 PM, "Shoaib Mir" <shoaibmir@gmail.com> wrote:

On Wed, Nov 10, 2010 at 1:17 PM, Tena Sakai <tsakai@gallo.ucsf.edu> wrote:

Can somebody please tell me how I find who it is using the
xxxxx database?


select * from pg_stat_activity where datname = '<yourdbname>';

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2010-11-10 02:32 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-11-10 02:17 I want to find out who is using a database Tena Sakai <tsakai@gallo.ucsf.edu>
2010-11-10 02:25 ` Samuel Stearns <SStearns@internode.com.au>
2010-11-10 02:31   ` Tena Sakai <tsakai@gallo.ucsf.edu>
2010-11-10 02:26 ` Shoaib Mir <shoaibmir@gmail.com>
2010-11-10 02:32   ` Tena Sakai <tsakai@gallo.ucsf.edu>

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