[PATCH] Add `truncate` option to subscription commands

From: David Christensen <david(at)endpoint(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: [PATCH] Add `truncate` option to subscription commands
Date: 2020-10-09 18:54:01
Message-ID: CF3B6672-2A43-4204-A60A-68F359218A9B@endpoint.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

-hackers,

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

Best,

David

Attachment Content-Type Size
0001-Add-truncate-option-to-subscription-commands.patch application/octet-stream 16.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2020-10-09 18:57:56 Re: [PATCH] ecpg: fix progname memory leak
Previous Message Bruce Momjian 2020-10-09 18:53:25 Re: pg_upgrade: fail early if a tablespace dir already exists for new cluster version