Re: Manually clearing "database "foo" is being accessed by other users"

Поиск
Список
Период
Сортировка
От Steve Crawford
Тема Re: Manually clearing "database "foo" is being accessed by other users"
Дата
Msg-id 46F2CC9E.2080908@pinpointresearch.com
обсуждение исходный текст
Ответ на Manually clearing "database "foo" is being accessed by other users"  (Sysadmin <linux@alteeve.com>)
Ответы Re: Manually clearing "database "foo" is being accessed by other users"  (Madison Kelly <linux@alteeve.com>)
Список pgsql-general
Sysadmin wrote:
> Hi all,
>
>   I'm finding that routinely when I try to reload a database on a server
> where I know there are no connections to a given DB I get the error:
>
> $ dropdb foo && createdb foo -O bar && psql foo -f /path/to/db.out
> dropdb: database removal failed: ERROR:  database "foo" is being
> accessed by other users
>
>   This means I need to restart the postmaster, but the server contains
> many DBs, of which some may actually be in use. How can I tell postgres
> that the database 'foo' should be marked as not in use / clear or drop
> any open connections / etc?

If you connect to "foo" and run "select * from pg_stat_activity;" what
does it show?

Have you tried changing pg_hba.conf (and reloading PG and waiting for
current connections to terminate of course) to deny access to foo before
running your commands?

Is there a pg_dumpall (or anything else that might access that db at the
PG superuser level) running at the time?

Cheers,
Steve

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Manually clearing "database "foo" is being accessed by other users"
Следующее
От: Robert Fitzpatrick
Дата:
Сообщение: Re: autovacuum