Re: PG replicas and transactions atomicity

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Bhautik Chudasama <bhautikrchudasama(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: PG replicas and transactions atomicity
Date: 2023-01-06 03:46:48
Message-ID: A865FACB-6799-43E5-A2EF-D65EB9CAAA78@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Jan 5, 2023, at 19:38, Bhautik Chudasama <bhautikrchudasama(at)gmail(dot)com> wrote:
>
> Does it mean when we commit transaction, client will wait until all replicas successfully committed the transaction.

It depends. If all the settings are the defaults, no, the client won't wait for the replicas to acknowledge the commit of the transaction. This is asynchronous replication.

Synchronous replication can be set up, though, in which case the client will wait until some or all of the replicas have reported back that they've committed, depending on how it is configured. The documentation explains the detailsl:

https://www.postgresql.org/docs/current/warm-standby.html#SYNCHRONOUS-REPLICATION

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2023-01-06 05:28:12 Re: postgres restore & needed history files
Previous Message Christophe Pettus 2023-01-06 00:04:27 Re: PG replicas and transactions atomicity