Обсуждение: 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
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
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
On Wed, Nov 10, 2010 at 1:17 PM, Tena Sakai <tsakai@gallo.ucsf.edu> wrote:
--
Shoaib Mir
http://shoaibmir.wordpress.com/
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/
Thank you, Sam.
Tena
On 11/9/10 6:25 PM, "Samuel Stearns" <SStearns@internode.com.au> wrote:
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
Thank you, Shoaib.
Tena
On 11/9/10 6:26 PM, "Shoaib Mir" <shoaibmir@gmail.com> wrote:
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>';