postgresql/src
Fujii Masao a82ba066ea Remove erroneous assertion from pg_copy_logical_replication_slot().
If restart_lsn of logical replication slot gets behind more than
max_slot_wal_keep_size from the current LSN, the logical replication slot
would be invalidated and its restart_lsn is reset to an invalid LSN.
If this logical replication slot with an invalid restart_lsn was specified as
the source slot in pg_copy_logical_replication_slot(), the function caused
the assertion failure unexpectedly.

This assertion was added because restart_lsn should not be invalid before.
But in v13, it can be invalid thanks to max_slot_wal_keep_size. So since this
assertion is no longer useful, this commit removes it.

This commit also changes the errcode in the error message that
pg_copy_logical_replication_slot() emits when the slot with an invalid
restart_lsn is specified, to more appropriate one.

Back-patch to v13 where max_slot_wal_keep_size was added and
the assertion was no longer valid.

Author: Fujii Masao
Reviewed-by: Alvaro Herrera, Kyotaro Horiguchi
Discussion: https://postgr.es/m/f91de4fb-a7ab-b90e-8132-74796e049d51@oss.nttdata.com
2020-06-25 11:13:13 +09:00
..
backend Remove erroneous assertion from pg_copy_logical_replication_slot(). 2020-06-25 11:13:13 +09:00
bin Add --no-index-cleanup and --no-truncate to vacuumdb. 2020-06-22 13:23:38 +09:00
common Move frontend-side archive APIs from src/common/ to src/fe_utils/ 2020-06-11 15:48:46 +09:00
fe_utils Move frontend-side archive APIs from src/common/ to src/fe_utils/ 2020-06-11 15:48:46 +09:00
include Adjust max_slot_wal_keep_size behavior per review 2020-06-24 14:23:39 -04:00
interfaces Error message refactoring 2020-06-15 08:46:56 +02:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Avoid using a cursor in plpgsql's RETURN QUERY statement. 2020-06-12 12:14:32 -04:00
port Clear some style deviations. 2020-05-21 08:31:16 -07:00
template Fix compiler warning for ppoll() on Cygwin 2019-12-22 23:20:00 +01:00
test Adjust max_slot_wal_keep_size behavior per review 2020-06-24 14:23:39 -04:00
timezone Fix compiler warning induced by commit d8b15eeb8. 2020-06-24 15:47:30 -04:00
tools Remove reset of testtablespace from pg_regress on Windows 2020-06-18 10:40:10 +09:00
tutorial Update copyrights for 2020 2020-01-01 12:21:45 -05:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Update Unicode data to Unicode 13.0.0 and CLDR 37 2020-04-24 09:52:59 +02:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00