Re: Running Postgres Daemons with same data files - Mailing list pgsql-admin

From Jeff
Subject Re: Running Postgres Daemons with same data files
Date
Msg-id 20031211083936.46ddb129.threshar@torgo.978.org
Whole thread Raw
In response to Re: Running Postgres Daemons with same data files  (Bhartendu Maheshwari <bhartendum@jataayusoft.com>)
List pgsql-admin
On 11 Dec 2003 18:13:07 +0530
Bhartendu Maheshwari <bhartendum@jataayusoft.com> wrote:

> Dear matt
>
> Don't joke, this for stopping the Postgres Server. I want close the
> files in between the database operations. I am looking for some SQL
> command like in Mysql command is 'flush tables'. what's in postgres?
>
> regards
> bhartendu
>


forcing a checkpoint or using commit may get those tables flushed out.
(or at least the wal). but the problem is other postmasters on other
machines may not know that data has changed - it could be sitting in a
shared buffer.

Machine A reads block 123, stored in a shared buffer.
Machine B reads block 123, modifies it, writes it back out
Machine A needs block 123, finds it in its shared buffer and uses that
data [which is no longer valid]

Thus you can see the problems.

or another one

Machine A locks row 123 for update
Machine B also wants to lock row 123.  How does it know A already has
the lock? (locks are stored in shared memory)

What you really want is multi-master replication.  Currently this
doesn't exist on PG (that I know of).  There's a JDBC app that simulates
it. (And you could too, to varying degrees of success).

If mysql works, then use it, but I'd be suprised if it didn't suffer a
lot of these same problems as well.

If you seriously need this feature, then you'll either have to A. buy
oracle/whatever or B. pay to fund development of it for PG

--
Jeff Trout <jeff@jefftrout.com>
http://www.jefftrout.com/
http://www.stuarthamm.net/

pgsql-admin by date:

Previous
From: Sam Barnett-Cormack
Date:
Subject: Re: Running Postgres Daemons with same data files
Next
From: Tom Lane
Date:
Subject: Re: Postrgres data restoration problem