Re: Question about transactions and pg_log

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <martijn(at)ecomtel(dot)com(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Question about transactions and pg_log
Date: 2001-02-06 00:56:13
Message-ID: 18968.981420973@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <martijn(at)ecomtel(dot)com(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message <No Name> 2001-02-06 01:26:44 Re: GUI Clients for PostgreSQL
Previous Message Peter Eisentraut 2001-02-06 00:13:57 Re: Source code of the procedures/Functions in PostgreSQL - Where?