1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-28 02:33:10 +03:00
Fujii Masao d5751c33cc Avoid ERROR in recovery target GUC assign hooks
Recovery target parameters are postmaster-startup GUCs, but their
assign hooks previously did more than assign individual parameter
values. They also updated the global recoveryTarget state and raised
ERROR if more than one recovery target appeared to be set.

This was not a good fit for GUC assign hooks. Assign hooks should not
throw ERROR, and deriving cross-parameter state while individual GUCs
are still being assigned makes the result depend on assignment order
rather than the final configuration.

For example, setting one recovery target and then setting another
recovery_target_* parameter to an empty string could clear
recoveryTarget, causing recovery to proceed with no target even
though a valid target remained configured.

Fix this by having the assign hooks only store their own parameter
values. The effective recoveryTarget is now derived once from the
final recovery_target* settings in
validateRecoveryParameters(), which also rejects configurations that
specify more than one recovery target with FATAL. This preserves the
expected behavior for repeated assignments of the same GUC, treats empty
values as "not set", and removes cross-GUC validation from the assign
hooks.

Author: JoongHyuk Shin <sjh910805@gmail.com>
Reviewed-by: Greg Lamberson <greg@lamco.io>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Scott Ray <scott@scottray.io>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Reviewed-by: Henson Choi <assam258@gmail.com>
Reviewed-by: Zsolt Parragi <zsolt.parragi@percona.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CACSdjfPUa4UvKjADgOERXoxNYmCg2mqqiqKkiJk6mX6E4qgVFw@mail.gmail.com
2026-07-20 21:42:19 +09:00
2026-07-17 11:48:35 -04:00
…
2026-07-16 12:03:05 +02:00
2026-01-01 13:24:10 -05:00
…
2026-02-23 13:34:22 -05:00
…

PostgreSQL Database Management System

This directory contains the source code distribution of the PostgreSQL database management system.

PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.

Copyright and license information can be found in the file COPYRIGHT.

General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.

The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.

Description
Зеркало официального репозитория PostgreSQL GIT
Readme 1.3 GiB
Languages
C 83.9%
PLpgSQL 6.2%
Perl 5.4%
Yacc 1.2%
Meson 0.7%
Other 2.4%