Re: Some newbie questions

From: Greg Smith <gsmith(at)gregsmith(dot)com>
To: M2Y <mailtoyahoo(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Some newbie questions
Date: 2008-09-09 08:50:27
Message-ID: Pine.GSO.4.64.0809090411310.572@westnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 7 Sep 2008, M2Y wrote:

> Why does a replication solution need log shipping and why cant we just
> ship the transaction statements to a standby node?

Here's one of the classic examples of why that doesn't work:

create table x (d decimal);
insert into x values (random());

If you execute those same statements on two different nodes, they will end
up with different values for the random number and therefore the nodes
won't match anymore. A similar issue shows up if you use functions that
check the current system time, that will be slightly different between the
two: even if the clocks are perfectly synced, by the time the standy
received the transaction it will be later than the original.

--
* Greg Smith gsmith(at)gregsmith(dot)com http://www.gregsmith.com Baltimore, MD

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2008-09-09 09:24:30 Re: Synchronous Log Shipping Replication
Previous Message Magnus Hagander 2008-09-09 08:18:33 Re: [gsmith@gregsmith.com: Re: [patch] GUC source file and line number]