Re: Can't Use DB As Template - accessed by other users error

From: Andrew Hammond <ahammond(at)ca(dot)afilias(dot)info>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Can't Use DB As Template - accessed by other users error
Date: 2005-05-04 13:41:34
Message-ID: 4278D10E.9050908@ca.afilias.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


> [I'm not very sure about this would be the right way to achieve what
> you want, but]
> List the users, their PIDs and which query they currently on:
>
> => SELECT procpid, usename, current_query FROM pg_stat_activity;
>
> Check users and their queries. If the "kill [-9] procpid" will be
> harmful for that user, just warn him/her. Or try some other
> combinations of this messy idea.

The above query will get you a list of PIDs that are accessing the db.
At the command line, as user postgres, do a kill -2 on those PIDs. DO
NOT kill -9 them.

If you don't find any entries in the pg_stat_activity table, then it may
be the case that you're not monitoring it. In that case, again as user
postgres, do a ps xww to find connections and then kill them as
described previously.

All of the above assumes that you're running on a unix platform.

Drew

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Andrew Hammond 2005-05-04 13:56:10 Re: comparison trigger function
Previous Message Keith Worthington 2005-05-03 21:21:19 comparison trigger function