pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jerry Sievers <gsievers19@comcast.net>
To: Yambu <hyambu@gmail.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Logical replication and truncate table
Date: Wed, 23 Dec 2020 11:03:52 -0600
Message-ID: <87v9cslaiv.fsf@jsievers.enova.com> (raw)
In-Reply-To: <CALhHtcCP2RBR5bsnRA3nYLXF1qdUhbFRGU3+=DRFC_SNYDLscg@mail.gmail.com>
References: <CALhHtcCP2RBR5bsnRA3nYLXF1qdUhbFRGU3+=DRFC_SNYDLscg@mail.gmail.com>

Yambu <hyambu@gmail.com> writes:

> Hello
>
> Please confirm this , truncate a table on master db does not work
> well wilth logical replication?
> It results in duplicate key errors on slave right?

Trunc has been supported in native logical replication since V11.

Start by telling us what Pg version you're on and what logical
replication your using.

See the docs.
>
> We should rather use delete from table?
>
>

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net





view thread (4+ messages)  latest in thread

Message-ID: <87v9cslaiv.fsf@jsievers.enova.com>
Permalink:  ../87v9cslaiv.fsf@jsievers.enova.com/
Also on:    postgresql.org/message-id/87v9cslaiv.fsf@jsievers.enova.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: gsievers19@comcast.net, hyambu@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Logical replication and truncate table
  In-Reply-To: <87v9cslaiv.fsf@jsievers.enova.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox