From: | Álvaro Herrera <alvherre(at)kurilemu(dot)de> |
---|---|
To: | Kirill Reshke <reshkekirill(at)gmail(dot)com> |
Cc: | jian he <jian(dot)universality(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt |
Date: | 2025-08-22 15:34:06 |
Message-ID: | 202508221534.z4xe7cg4dwsu@alvherre.pgsql |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 2025-Aug-22, Kirill Reshke wrote:
> I am sorry: I am not following. CREATE STATISTIC will work only for
> single HEAP (or other AM) relations. So, for "simple regular tables"
> as one can say (not tablefunc).
Ah yeah, you're right, I think we should say "a single table", or maybe
"a single table or materialized view" if the latter case is supported (I
don't remember offhand if it is).
The error message is mostly concerned with rejecting the case of
multiple relations being given in the FROM clause, because we said at
the time that we needed to make the grammar flexible enough to support
that case, but make it clear that it wasn't implemented yet. (It's a
pity that we haven't implemented that thus far ... I suppose it must be
a difficult problem.)
> DETAIL: This operation is not supported for query result.
I would say "This operation is only supported for tables [and
matviews]." We don't need to list all the things that aren't supported,
I think. But your example here is wrong:
> db=# CREATE STATISTICS alt_stat2 ON a, b FROM tftest(1);
> ERROR: cannot define statistics for relation "alt_stat2"
> DETAIL: This operation is not supported for query result.
It's not alt_stat2 that's the problem (that's the extstats object being
created), but tftest(1). I don't know if we need to specify that the
problem is in the FROM clause here -- seems obvious enough to me -- but
maybe someone opines differently?
ERROR: cannot define statistics for relation "tftest"
DETAIL: The FROM clause may only contain a single table.
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"Si quieres ser creativo, aprende el arte de perder el tiempo"
From | Date | Subject | |
---|---|---|---|
Next Message | Álvaro Herrera | 2025-08-22 15:35:20 | Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt |
Previous Message | Sergey Soloviev | 2025-08-22 15:27:16 | [BUG] Remove self joins causes 'variable not found in subplan target lists' error |