From: Michael Paquier Date: Thu, 29 Jan 2026 05:57:47 +0000 (+0900) Subject: Fix two error messages in extended_stats_funcs.c X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=740a1494f4bfb470b16e5b70c79fae473b1a655d;p=thirdparty%2Fpostgresql.git Fix two error messages in extended_stats_funcs.c These have been fat-fingered in 0e80f3f88dea and 302879bd68d1. The error message for ndistinct had an incorrect grammar, while the one for dependencies had finished with a period (incorrect based on the project guidelines). Discussion: https://postgr.es/m/aXrsjZQbVuB6236u@paquier.xyz --- diff --git a/src/backend/statistics/extended_stats_funcs.c b/src/backend/statistics/extended_stats_funcs.c index 6fff31330e6..db107684607 100644 --- a/src/backend/statistics/extended_stats_funcs.c +++ b/src/backend/statistics/extended_stats_funcs.c @@ -418,7 +418,7 @@ extended_statistics_update(FunctionCallInfo fcinfo) { ereport(WARNING, errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("cannot not specify parameter \"%s\"", + errmsg("cannot specify parameter \"%s\"", extarginfo[NDISTINCT_ARG].argname), errhint("Extended statistics object \"%s\".\"%s\" does not support statistics of this type.", quote_identifier(nspname), @@ -436,7 +436,7 @@ extended_statistics_update(FunctionCallInfo fcinfo) { ereport(WARNING, errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("cannot specify parameter \"%s\".", + errmsg("cannot specify parameter \"%s\"", extarginfo[DEPENDENCIES_ARG].argname), errhint("Extended statistics object \"%s\".\"%s\" does not support statistics of this type.", quote_identifier(nspname), diff --git a/src/test/regress/expected/stats_import.out b/src/test/regress/expected/stats_import.out index 284a49bbc4e..37131f9ceab 100644 --- a/src/test/regress/expected/stats_import.out +++ b/src/test/regress/expected/stats_import.out @@ -1761,7 +1761,7 @@ SELECT pg_catalog.pg_restore_extended_stats( 'statistics_name', 'test_stat_dependencies', 'inherited', false, 'n_distinct', '[{"attributes" : [1,3], "ndistinct" : 4}]'::pg_ndistinct); -WARNING: cannot not specify parameter "n_distinct" +WARNING: cannot specify parameter "n_distinct" HINT: Extended statistics object "stats_import"."test_stat_dependencies" does not support statistics of this type. pg_restore_extended_stats --------------------------- @@ -1777,7 +1777,7 @@ SELECT pg_catalog.pg_restore_extended_stats( 'inherited', false, 'dependencies', '[{"attributes": [2], "dependency": 3, "degree": 1.000000}, {"attributes": [3], "dependency": 2, "degree": 1.000000}]'::pg_dependencies); -WARNING: cannot specify parameter "dependencies". +WARNING: cannot specify parameter "dependencies" HINT: Extended statistics object "stats_import"."test_stat_ndistinct" does not support statistics of this type. pg_restore_extended_stats ---------------------------