Fix the error hint message and test for reset_shared with unknown stats type

Started by Maksim Logvinenko26 days ago4 messageshackers
Jump to latest
#1Maksim Logvinenko
logvinenko-ms@yandex.ru

<div><div><div>Hi hackers,</div><div> </div><div>The errhint() in pg_stat_reset_shared() were missing the fact that recently added in [1] new lock stats kind.</div><div>The patch fixes error hint message and regress test for reset_shared with unknown stats type.</div><div> </div><div>[1]: /messages/by-id/aIyNxBWFCybgBZBS@ip-10-97-1-34.eu-west-3.compute.internal&lt;/div&gt;&lt;div&gt;%C2%A0&lt;/div&gt;&lt;div&gt;Best regards,</div><div>Maksim Logvinenko</div><div>Postgres Professional: http://postgrespro.com&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

#2Maksim Logvinenko
logvinenko-ms@yandex.ru
In reply to: Maksim Logvinenko (#1)
Re: Fix the error hint message and test for reset_shared with unknown stats type

Attachments:

0001-Fix-the-error-hint-message-and-test-for-reset_shared.patchtext/x-diff; name=0001-Fix-the-error-hint-message-and-test-for-reset_shared.patchDownload+2-3
#3Michael Paquier
michael@paquier.xyz
In reply to: Maksim Logvinenko (#2)
Re: Fix the error hint message and test for reset_shared with unknown stats type

On Tue, Apr 28, 2026 at 08:18:21PM +0500, Maksim Logvinenko wrote:

The existing error hint message and test were missing the fact that
recently added new lock stats kind.

@@ -1987,7 +1987,7 @@ pg_stat_reset_shared(PG_FUNCTION_ARGS)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("unrecognized reset target: \"%s\"", target),
-				 errhint("Target must be \"archiver\", \"bgwriter\", \"checkpointer\", \"io\", \"recovery_prefetch\", \"slru\", or \"wal\".")));
+				 errhint("Target must be \"archiver\", \"bgwriter\", \"checkpointer\", \"io\", \"lock\", \"recovery_prefetch\", \"slru\", or \"wal\".")));

Right, thanks for the report, Maksim. I'll fix it later.
--
Michael

#4Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#3)
Re: Fix the error hint message and test for reset_shared with unknown stats type

On Wed, Apr 29, 2026 at 08:12:04AM +0900, Michael Paquier wrote:

Right, thanks for the report, Maksim. I'll fix it later.

And done.
--
Michael