diff options
author | Amit Kapila | 2022-03-22 01:41:19 +0000 |
---|---|---|
committer | Amit Kapila | 2022-03-22 01:41:19 +0000 |
commit | 208c5d65bbd60e33e272964578cb74182ac726a8 (patch) | |
tree | 5f3a99783f4c7be35c16237c5b10ebc711b37293 /src/bin/psql/describe.c | |
parent | 315ae75e9b6da72456eaa44e55ace9ab1b95ef74 (diff) |
Add ALTER SUBSCRIPTION ... SKIP.
This feature allows skipping the transaction on subscriber nodes.
If incoming change violates any constraint, logical replication stops
until it's resolved. Currently, users need to either manually resolve the
conflict by updating a subscriber-side database or by using function
pg_replication_origin_advance() to skip the conflicting transaction. This
commit introduces a simpler way to skip the conflicting transactions.
The user can specify LSN by ALTER SUBSCRIPTION ... SKIP (lsn = XXX),
which allows the apply worker to skip the transaction finished at
specified LSN. The apply worker skips all data modification changes within
the transaction.
Author: Masahiko Sawada
Reviewed-by: Takamichi Osumi, Hou Zhijie, Peter Eisentraut, Amit Kapila, Shi Yu, Vignesh C, Greg Nancarrow, Haiying Tang, Euler Taveira
Discussion: https://postgr.es/m/CAD21AoDeScrsHhLyEPYqN3sydg6PxAPVBboK=30xJfUVihNZDA@mail.gmail.com
Diffstat (limited to 'src/bin/psql/describe.c')
-rw-r--r-- | src/bin/psql/describe.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 991bfc1546b..714097cad1b 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -6105,7 +6105,7 @@ describeSubscriptions(const char *pattern, bool verbose) PGresult *res; printQueryOpt myopt = pset.popt; static const bool translate_columns[] = {false, false, false, false, - false, false, false, false, false, false}; + false, false, false, false, false, false, false}; if (pset.sversion < 100000) { @@ -6152,6 +6152,12 @@ describeSubscriptions(const char *pattern, bool verbose) ", subconninfo AS \"%s\"\n", gettext_noop("Synchronous commit"), gettext_noop("Conninfo")); + + /* Skip LSN is only supported in v15 and higher */ + if (pset.sversion >= 150000) + appendPQExpBuffer(&buf, + ", subskiplsn AS \"%s\"\n", + gettext_noop("Skip LSN")); } /* Only display subscriptions in current database. */ |