postgresql/src/include
Amit Kapila 0e091ce409 Fix an oversight in 3f28b2fcac.
Commit 3f28b2fcac tried to ensure that the replication origin shouldn't be
advanced in case of an ERROR in the apply worker, so that it can request
the same data again after restart. However, it is possible that an ERROR
was caught and handled by a (say PL/pgSQL) function, and  the apply worker
continues to apply further changes, in which case, we shouldn't reset the
replication origin.

Ensure to reset the origin only when the apply worker exits after an
ERROR.

Commit 3f28b2fcac added new function geterrlevel, which we removed in HEAD
as part of this commit, but kept it in backbranches to avoid breaking any
applications. A separate case can be made to have such a function even for
HEAD.

Reported-by: Shawn McCoy <shawn.the.mccoy@gmail.com>
Author: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: vignesh C <vignesh21@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Backpatch-through: 16, where it was introduced
Discussion: https://postgr.es/m/CALsgZNCGARa2mcYNVTSj9uoPcJo-tPuWUGECReKpNgTpo31_Pw@mail.gmail.com
2025-04-23 11:08:24 +05:30
..
access Fix typos and grammar in the code 2025-04-19 19:17:42 +09:00
archive Update copyright for 2025 2025-01-01 11:21:55 -05:00
backup Update copyright for 2025 2025-01-01 11:21:55 -05:00
bootstrap pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
catalog Assert lack of hazardous buffer locks before possible catalog read. 2025-04-17 05:00:30 -07:00
commands Harmonize function parameter names for Postgres 18. 2025-04-12 12:07:36 -04:00
common Update Unicode data to Unicode 16.0.0 2025-04-03 12:00:09 +02:00
datatype Avoid using timezone Asia/Manila in regression tests. 2025-01-20 15:47:53 -05:00
executor Change SQL-language functions to use the plan cache. 2025-04-02 14:06:02 -04:00
fe_utils pg_restore cleanups 2025-04-16 12:04:34 -04:00
foreign Update copyright for 2025 2025-01-01 11:21:55 -05:00
jit Fix grammatical typos around possessive "its" 2025-01-29 14:39:14 +07:00
lib Use PRI?64 instead of "ll?" in format strings (continued). 2025-03-29 10:43:57 +01:00
libpq Harmonize function parameter names for Postgres 18. 2025-04-12 12:07:36 -04:00
mb pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
nodes Fix typos and grammar in the code 2025-04-19 19:17:42 +09:00
optimizer Harmonize function parameter names for Postgres 18. 2025-04-12 12:07:36 -04:00
parser Extend ALTER DEFAULT PRIVILEGES to define default privileges for large objects. 2025-04-04 19:02:17 +09:00
partitioning Fix incorrect #endif comment 2025-03-10 13:36:04 +13:00
pch Update copyright for 2025 2025-01-01 11:21:55 -05:00
port Harmonize function parameter names for Postgres 18. 2025-04-12 12:07:36 -04:00
portability Update copyright for 2025 2025-01-01 11:21:55 -05:00
postmaster Add missing PGDLLIMPORT markings 2025-04-11 08:59:52 +02:00
regex Update copyright for 2025 2025-01-01 11:21:55 -05:00
replication Harmonize function parameter names for Postgres 18. 2025-04-12 12:07:36 -04:00
rewrite Eliminate code duplication in replace_rte_variables callbacks 2025-02-25 16:11:34 +09:00
snowball Update to latest Snowball sources. 2025-02-18 21:13:54 -05:00
statistics Stats: use schemaname/relname instead of regclass. 2025-03-25 11:16:06 -07:00
storage Fix a few duplicate words in comments 2025-04-21 10:41:18 +12:00
tcop Improve error message when standby does accept connections. 2025-04-02 15:13:01 +09:00
tsearch Update copyright for 2025 2025-01-01 11:21:55 -05:00
utils Fix an oversight in 3f28b2fcac. 2025-04-23 11:08:24 +05:30
.gitignore Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
c.h Revert "Use workaround of __builtin_setjmp only on MINGW on MSVCRT" 2025-04-07 11:01:15 -04:00
fmgr.h Avoid mixing designated and non-designated field initializers. 2025-03-27 11:06:30 -04:00
funcapi.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
getopt_long.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
Makefile Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
miscadmin.h Fix a few oversights in the longer cancel keys patch 2025-04-09 13:11:42 +03:00
pg_config.h.in Update pg_config.h.in with libnuma changes 2025-04-16 20:16:57 +02:00
pg_config_manual.h Avoid invalidating all RelationSyncCache entries on publication rename. 2025-03-13 09:16:33 +05:30
pg_getopt.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
pg_trace.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
pgstat.h pgstat: Allow checksum errors to be reported in critical sections 2025-03-30 16:12:04 -04:00
pgtar.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgtime.h Seek zone abbreviations in the IANA data before timezone_abbreviations. 2025-01-16 14:11:19 -05:00
port.h Add timingsafe_bcmp(), for constant-time memory comparison 2025-04-02 15:32:40 +03:00
postgres.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
postgres_ext.h libpq: Deprecate pg_int64. 2025-03-25 21:40:00 +13:00
postgres_fe.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
varatt.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
windowapi.h Update copyright for 2025 2025-01-01 11:21:55 -05:00