git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 6897f0e) | patch
Assign error codes where missing for user-facing failures
Thu, 4 Jul 2024 00:48:40 +0000 (09:48 +0900)
Thu, 4 Jul 2024 00:48:40 +0000 (09:48 +0900)
commit b81a71aa05f294705e1b1d4fe24548f175f9bfe9
Assign error codes where missing for user-facing failures

All the errors triggered in the code paths patched here would cause the
backend to issue an internal_error errcode, which is a state that should
be used only for "can't happen" situations. However, these code paths
are reachable by the regression tests, and could be seen by users in
valid cases. Some regression tests expect internal errcodes as they
manipulate the backend state to cause corruption (like checksums), or
use elog() because it is more convenient (like injection points), these
have no need to change.

This reduces the number of internal failures triggered in a check-world
by more than half, while providing correct errcodes for these valid
cases.

Reviewed-by: Robert Haas
Discussion: https://postgr.es/m/Zic_GNgos5sMxKoa@paquier.xyz
12 files changed:
contrib/pg_walinspect/pg_walinspect.c diff | blob | blame | history
src/backend/access/transam/xlogrecovery.c diff | blob | blame | history
src/backend/backup/basebackup.c diff | blob | blame | history
src/backend/commands/matview.c diff | blob | blame | history
src/backend/commands/tablecmds.c diff | blob | blame | history
src/backend/commands/trigger.c diff | blob | blame | history
src/backend/commands/user.c diff | blob | blame | history
src/backend/libpq/be-secure-openssl.c diff | blob | blame | history
src/backend/optimizer/util/appendinfo.c diff | blob | blame | history
src/backend/replication/slotfuncs.c diff | blob | blame | history
src/backend/utils/adt/pg_locale.c diff | blob | blame | history
src/backend/utils/adt/tid.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /