Re: Question about transactions and pg_log

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question about transactions and pg_log
Дата
Msg-id 18968.981420973@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Question about transactions and pg_log  (Martijn van Oosterhout <martijn@ecomtel.com.au>)
Список pgsql-general
Martijn van Oosterhout <martijn@ecomtel.com.au> writes:
> From what I currently understand, there is a pg_log file in the postgres
> data directory which indicates the state of transactions (committed or
> uncommitted).
> So from this I infer that transaction IDs are unique across a whole database
> installation?

Correct, and correct.

> The reason I ask is that I rename the directories within the data directory
> to rename a database. (I need to switch two databases reasonably quickly).
> If transaction IDs (and hence entries within pg_log) are not shared then the
> results would be catastrophic probably.

This strikes me as pretty darn dangerous in any case.  You could maybe
get away with it if you shutdown the postmaster first, but if you don't,
then you *will* get screwed by buffering considerations (open disk
buffers in shared memory are out of sync with the disk files after you
do the swap).

In 7.1 I believe you can rename a database just by updating its row in
pg_database.  You'd probably be far safer to run a 7.1 beta release and
do that, than to try to do it by renaming directories in previous
releases.

            regards, tom lane

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

Предыдущее
От: Craig Orsinger
Дата:
Сообщение: Re: Write to postgreSQL via ODBC?
Следующее
От: "Brett W. McCoy"
Дата:
Сообщение: Re: How to install SQL 7.0