Split CREATE STATISTICS error reasons out into errdetails

John Naylor <john.naylor@postgresql.org>

Commit: 51098839cfb40dc496bb48fe4ea14d19170099ac
Author: John Naylor <john.naylor@postgresql.org>
Date: 2026-04-07T04:37:48Z
Split CREATE STATISTICS error reasons out into errdetails

Some errmsgs in statscmds.c were phrased as "...cannot be used
because...". Put the reasons into errdetails. While at it, switch
from passive voice to "cannot create..." for the errmsg.

Author: Yugo Nagata <nagata@sraoss.co.jp>
Suggested-by: John Naylor <johncnaylorls@gmail.com>
Discussion: https://postgr.es/m/CANWCAZaZeX0omWNh_ZbD_JVujzYQdRUW8UZOQ4dWh9Sg7OcAow@mail.gmail.com

Files

PathChange+/−
src/backend/commands/statscmds.c modified +11 −6
src/test/regress/expected/stats_ext.out modified +2 −1

Discussion