Re: [PATCH] Add `truncate` option to subscription commands

From: Euler Taveira <euler(dot)taveira(at)2ndquadrant(dot)com>
To: David Christensen <david(at)endpoint(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Add `truncate` option to subscription commands
Date: 2020-10-11 18:13:54
Message-ID: CAH503wBkx21fc5RBWLQFuxgrG43mVUN45oyUQBvORq2gH_YnsQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 9 Oct 2020 at 15:54, David Christensen <david(at)endpoint(dot)com> wrote:

>
> Enclosed find a patch to add a “truncate” option to subscription commands.
>
> When adding new tables to a subscription (either via `CREATE SUBSCRIPTION`
> or `REFRESH PUBLICATION`), tables on the target which are being newly
> subscribed will be truncated before the data copy step. This saves
> explicit coordination of a manual `TRUNCATE` on the target tables and
> allows the results of the initial data sync to be the same as on the
> publisher at the time of sync.
>
> To preserve compatibility with existing behavior, the default value for
> this parameter is `false`.
>
>
Truncate will fail for tables whose foreign keys refer to it. If such a
feature cannot handle foreign keys, the usefulness will be restricted.

Regards,

--
Euler Taveira http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christoph Berg 2020-10-11 18:35:13 Re: powerpc pg_atomic_compare_exchange_u32_impl: error: comparison of integer expressions of different signedness (Re: pgsql: For all ppc compilers, implement compare_exchange and) fetch_add
Previous Message David G. Johnston 2020-10-11 17:52:55 Re: Possible NULL dereferencing null pointer (src/backend/executor/nodeIncrementalSort.c)