Improving inferred query column names
От
Andres Freund
Тема
Improving inferred query column names
Дата
Msg-id
20230211192420.d4bvhrfys4tynpae@awork3.anarazel.de
Список
Дерево обсуждения
Improving inferred query column names Andres Freund <andres@anarazel.de>
Re: Improving inferred query column names Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: Improving inferred query column names Andres Freund <andres@anarazel.de>
Re: Improving inferred query column names Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: Improving inferred query column names "David G. Johnston" <david.g.johnston@gmail.com>
Re: Improving inferred query column names Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: Improving inferred query column names Vladimir Churyukin <vladimir@churyukin.com>
Re: Improving inferred query column names Andres Freund <andres@anarazel.de>
Re: Improving inferred query column names Vladimir Churyukin <vladimir@churyukin.com>
Re: Improving inferred query column names Tom Lane <tgl@sss.pgh.pa.us>
Re: Improving inferred query column names Andres Freund <andres@anarazel.de>
Re: Improving inferred query column names Tom Lane <tgl@sss.pgh.pa.us>
Re: Improving inferred query column names Joe Conway <mail@joeconway.com>
Re: Improving inferred query column names Corey Huinker <corey.huinker@gmail.com>
Hi, A common annoyance when writing ad-hoc analytics queries is column naming once aggregates are used. Useful column names: SELECT reads, writes FROM pg_stat_io; column names: reads, writes Not useful column names: SELECT SUM(reads), SUM(writes) FROM pg_stat_io; column names: sum, sum So i often end up manually writing: SELECT SUM(reads) AS sum_reads, SUM(writes) AS sum_writes, ... FROM pg_stat_io; Of course we can't infer useful column names for everything, but for something like this, it should't be too hard to do better. E.g. by combining the function name with the column name in the argument, if a single plain column is the argument. I think on a green field it'd be clearly better to do something like the above. What does give me pause is that it seems quite likely to break existing queries, and to a lesser degree, might break applications relying on inferred column names Can anybody think of a good way out of that? It's not like that problem is going to go away at some point... Greetings, Andres Freund
В списке pgsql-hackers по дате отправления
От: Andres Freund
Дата:
От: Andres Freund
Дата: