Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt
От | Kirill Reshke |
---|---|
Тема | Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt |
Дата | |
Msg-id | CALdSSPjb98dqy6bq4OmS23c7yYUDNET+pX6=G=SUFUQKe_ULmA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt (Álvaro Herrera <alvherre@kurilemu.de>) |
Ответы |
Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt
Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt |
Список | pgsql-hackers |
On Fri, 22 Aug 2025 at 14:46, Álvaro Herrera <alvherre@kurilemu.de> wrote: > > On 2025-Aug-21, Kirill Reshke wrote: > > > I wouldn’t say this is misleading, but " a single relation" is indeed > > not precise enough. IMO we need a more precise term to distinguish > > regular relation and table func. > > I'm not sure. See the definition of relation in the glossary: > https://www.postgresql.org/docs/18/glossary.html#GLOSSARY-RELATION > > The generic term for all objects in a database that have a name and a > list of attributes defined in a specific order. Tables, sequences, > views, foreign tables, materialized views, composite types, and > indexes are all relations. > > More generically, a relation is a set of tuples; for example, the > result of a query is also a relation. > > In PostgreSQL, Class is an archaic synonym for relation. > > (I wonder why this says "generically" rather than "generally". Is that > word choice a mistake?) Maybe in the "For example" clause we can also > mention table functions. > > -- > Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ 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). You say: relation is a term for both HEAP relation, tablefunc relation and much more. I say: "a single relation" in the error message is not precise enough. Where do we disagree? Anyway, I would say correct error message here should be: ``` 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. ``` -- Best regards, Kirill Reshke
В списке pgsql-hackers по дате отправления: