Re: Improve error messages for database object stats manipulation functions during recovery

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Improve error messages for database object stats manipulation functions during recovery
Date: 2024-11-15 17:36:54
Message-ID: 51c5fc9e-e234-491a-ab3c-5a882bec31f7@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2024/11/13 6:09, Heikki Linnakangas wrote:
> On 25/10/2024 20:07, Fujii Masao wrote:
>> 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?
>
> Makes sense.
>
> "Database object statistics manipulation functions" is a bit of a mouthful". Maybe something like "statistics cannot be modified during recovery".

Sounds good! I've updated the hint messages as suggested and attached the revised patch.
Thanks for the review!

Unless there are any objections, I'll proceed with committing it.

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

Attachment Content-Type Size
v2-0001-Improve-error-message-for-database-object-stats-m.patch text/plain 3.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2024-11-15 17:37:16 Re: Improve error messages for database object stats manipulation functions during recovery
Previous Message Dean Rasheed 2024-11-15 17:26:08 Re: psql: Add leakproof field to \dAo+ meta-command results