Improve error messages for database object stats manipulation functions during recovery
Fujii Masao <masao.fujii@oss.nttdata.com>
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2024-10-25T17:07:44Z
Lists: pgsql-hackers
Attachments
- v1-0001-Improve-error-message-for-database-object-stats-m.patch (text/plain) patch v1-0001
Hi,
When database object stats manipulation functions like pg_set_relation_stats() are run,
they currently produce the following error and hint messages, which are "internal"
and make it hard for users to understand the issue:
ERROR: cannot acquire lock mode ShareUpdateExclusiveLock on database objects while recovery is in progress
HINT: Only RowExclusiveLock or less can be acquired on database objects during recovery.
So I'd like to propose updating these to clearer messages:
ERROR: recovery is in progress
HINT: Database object statistics manipulation functions cannot be executed during recovery.
Thought?
I've attached a patch implementing these changes. It also updates the documentation to
clearly state that these functions are not available during recovery.
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
Commits
-
Improve error message for database object stats manipulation functions.
- c16645449687 18.0 landed