Re: Database in use?

Поиск
Список
Период
Сортировка
От Carol Walter
Тема Re: Database in use?
Дата
Msg-id F3C8672F-D4BF-4CE2-BD11-2524D26FC167@indiana.edu
обсуждение исходный текст
Ответ на Re: Database in use?  (John Lister <john.lister-ps@kickstone.com>)
Список pgsql-admin
I had forgotten that I had used Aqua Data Studio to draw ERD's for
this test database.  Even though, I closed it, it still had the
database open.  When I reopened it, and did a disconnect, if allowed
me to drop the database.

Thanks,

Carol

On Mar 4, 2009, at 4:45 PM, John Lister wrote:

> Have you got any copies of psql or tools like pgadmin open. I've
> been caught out by this. try
>
> select * from pg_stat_activity
>
> it should tell you what connections are open on the table (look at
> the datname column)
>
>
> Carol Walter wrote:
>> This has happened or is happening to me again, only this time, it's
>> a database that I just created.  I restored another database into a
>> test database.  One of the tables is empty.  I want to drop the
>> test database and create a new one.  When I try to drop the test
>> database, I get this error -
>> template1=# drop database km_tezt;
>> ERROR:  database "km_tezt" is being accessed by other users
>>
>> template1=# select * from pg_prepared_xacts;
>> transaction | gid | prepared | owner | database
>> -------------+-----+----------+-------+----------
>> (0 rows)
>>
>> This database is one that I created just a few hours ago just to
>> test some things myself.  There can be no one in it except me.  I
>> completely closed out of the database, closed out of the system,
>> and closed my terminal session.  Still I get the error.  This time
>> the database has not been accessed through PHP at all.
>>
>> Carol
>>
>> On Mar 2, 2009, at 8:31 PM, Tom Lane wrote:
>>
>>> Carol Walter <walterc@indiana.edu> writes:
>>>> I'm not sure I understand.  If there is a lag time between when
>>>> someone exits the database and when the database "knows" that no
>>>> one
>>>> is still in it, then that shouldn't be the problem here.  I tried a
>>>> number of time over the course of 24 hours to rename the database
>>>> and
>>>> it always reported that the database was in use.  No one was
>>>> logged in
>>>> but me, but the database still reported that the database was in
>>>> use.
>>>
>>> Hmph.  Are you sure nothing was connected?  One thing that
>>> frequently
>>> trips people up here is uncommitted prepared transactions --- look
>>> in
>>> pg_prepared_xacts.
>>>
>>>            regards, tom lane
>>>
>>> --
>>> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgsql-admin
>>
>>


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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Database in use?
Следующее
От: Carol Walter
Дата:
Сообщение: Re: Database in use?