Re: Can't Use DB As Template - accessed by other users error - Mailing list pgsql-novice

From Andrew Hammond
Subject Re: Can't Use DB As Template - accessed by other users error
Date
Msg-id 4278D10E.9050908@ca.afilias.info
Whole thread Raw
In response to Re: Can't Use DB As Template - accessed by other users error  (Volkan YAZICI <volkan.yazici@gmail.com>)
List 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

pgsql-novice by date:

Previous
From: "Keith Worthington"
Date:
Subject: comparison trigger function
Next
From: Andrew Hammond
Date:
Subject: Re: comparison trigger function