pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Logical replication and truncate table
4+ messages / 3 participants
[nested] [flat]

* Logical replication and truncate table
@ 2020-12-23 15:21  Yambu <hyambu@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Yambu @ 2020-12-23 15:21 UTC (permalink / raw)
  To: Pgsql-admin <pgsql-admin@lists.postgresql.org>

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?

We should rather use delete from table?

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Logical replication and truncate table
@ 2020-12-23 17:03  Jerry Sievers <gsievers19@comcast.net>
  parent: Yambu <hyambu@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Jerry Sievers @ 2020-12-23 17:03 UTC (permalink / raw)
  To: Yambu <hyambu@gmail.com>; +Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>

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





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Logical replication and truncate table
@ 2020-12-24 07:24  Yambu <hyambu@gmail.com>
  parent: Jerry Sievers <gsievers19@comcast.net>
  0 siblings, 1 reply; 4+ messages in thread

From: Yambu @ 2020-12-24 07:24 UTC (permalink / raw)
  To: Jerry Sievers <gsievers19@comcast.net>; +Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>

Hi

We are using Pg V10 , streaming , async

On Wed, Dec 23, 2020 at 7:04 PM Jerry Sievers <gsievers19@comcast.net>
wrote:

> 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
>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Logical replication and truncate table
@ 2020-12-27 10:08  hubert depesz lubaczewski <depesz@depesz.com>
  parent: Yambu <hyambu@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: hubert depesz lubaczewski @ 2020-12-27 10:08 UTC (permalink / raw)
  To: Yambu <hyambu@gmail.com>; +Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>

On Thu, Dec 24, 2020 at 09:24:15AM +0200, Yambu wrote:
> Hi
> We are using Pg V10 , streaming , async 

So yeah - delete is your friend for now. But you should consider
upgrading. There are MANY new features since v10:
https://why-upgrade.depesz.com/show?from=10&to=13.1

Best regards,

depesz






^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2020-12-27 10:08 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-12-23 15:21 Logical replication and truncate table Yambu <hyambu@gmail.com>
2020-12-23 17:03 ` Jerry Sievers <gsievers19@comcast.net>
2020-12-24 07:24   ` Yambu <hyambu@gmail.com>
2020-12-27 10:08     ` hubert depesz lubaczewski <depesz@depesz.com>

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