Re: postgres 8.2.9 can't drop database in single user mode

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: postgres 8.2.9 can't drop database in single user mode
Дата
Msg-id 6696.1240421460@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: postgres 8.2.9 can't drop database in single user mode  ("Maria L. Wilson" <Maria.L.Wilson-1@nasa.gov>)
Ответы Re: postgres 8.2.9 can't drop database in single user mode
Список pgsql-admin
"Maria L. Wilson" <Maria.L.Wilson-1@nasa.gov> writes:
> Question - is there any maintenance type item that we could to to check
> for uncommitted transactions on a regular basis - outside of the
> pg_prepared_xacts table?

pg_prepared_xacts is the only SQL-level visibility there is.  From a
monitoring standpoint it might be easier to watch for files in the
$PGDATA/pg_twophase/ directory, but that's just a different view of
the same information.

>        How about from a developers position - most of our code accessing
> the databases is jboss/java/jdbc.   What could have happened from the
> code side that caused these uncommitted             transactions?

Basically, somebody issued PREPARE TRANSACTION and then walked away
without either committing or rolling back.  As a rule it's a bad idea
to use PREPARE TRANSACTION unless you've bought into the whole XA
concept including an external "transaction monitor" that keeps track
of open two-phase transactions across a set of related databases.

If you don't think that there is anything like that that this DB should
be involved in, you might want to set max_prepared_transactions = 0
to prevent future mistaken issuances of PREPARE TRANSACTION.
(Bear in mind that you have to restart Postgres to make such a change
take effect.)

            regards, tom lane

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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: postgres 8.2.9 can't drop database in single user mode
Следующее
От: Shrirang Chitnis
Дата:
Сообщение: