summaryrefslogtreecommitdiff
path: root/src/backend/tcop/utility.c
diff options
context:
space:
mode:
authorÁlvaro Herrera <alvherre@kurilemu.de>2025-08-29 14:43:47 +0200
committerÁlvaro Herrera <alvherre@kurilemu.de>2025-08-29 14:43:47 +0200
commitf225473cbae2cca5e1fde376aa4217a6b3a3f770 (patch)
tree09cb04cb622e4b792a11fa81685407495c0860d0 /src/backend/tcop/utility.c
parent5d7f58848ce59d9e09b7214d2541ab3ec853f89c (diff)
CREATE STATISTICS: improve misleading error message
I think the error message for a different condition was inadvertently copied. This problem seems to have been introduced by commit a4d75c86bf15. Author: Álvaro Herrera <alvherre@kurilemu.de> Reported-by: jian he <jian.universality@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Backpatch-through: 14 Discussion: https://postgr.es/m/CACJufxEZ48toGH0Em_6vdsT57Y3L8pLF=DZCQ_gCii6=C3MeXw@mail.gmail.com
Diffstat (limited to 'src/backend/tcop/utility.c')
-rw-r--r--src/backend/tcop/utility.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c
index 4f4191b0ea6..5f442bc3bd4 100644
--- a/src/backend/tcop/utility.c
+++ b/src/backend/tcop/utility.c
@@ -1874,7 +1874,8 @@ ProcessUtilitySlow(ParseState *pstate,
if (!IsA(rel, RangeVar))
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("only a single relation is allowed in CREATE STATISTICS")));
+ errmsg("cannot create statistics on the specified relation"),
+ errdetail("CREATE STATISTICS only supports tables, foreign tables and materialized views.")));
/*
* CREATE STATISTICS will influence future execution plans