Improve error message for database object stats manipulation functions. Previously, database object statistics manipulation functions like pg_set_relation_stats() reported unclear error and hint messages when executed during recovery. These messages were "internal", making it difficult 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. This commit updates the error handling so that, if these functions are called during recovery, they produce clearer messages: ERROR: recovery is in progress HINT: Statistics cannot be modified during recovery. The related documentation has also been updated to explicitly clarify that these functions are not available during recovery. Author: Fujii Masao Reviewed-by: Heikki Linnakangas, Maxim Orlov Discussion: https://postgr.es/m/6d313829-5f56-4a28-ae4b-bd01bf1ae...@oss.nttdata.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/c166454496876818216e222890ab1ae788551c42 Modified Files -------------- doc/src/sgml/func.sgml | 1 + src/backend/statistics/attribute_stats.c | 12 ++++++++++++ src/backend/statistics/relation_stats.c | 6 ++++++ 3 files changed, 19 insertions(+)