Re: Improving inferred query column names

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>
Cc: Vladimir Churyukin <vladimir(at)churyukin(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Improving inferred query column names
Date: 2023-02-23 13:15:54
Message-ID: 3e734990-f5ca-27bd-d4c4-794bf7165bb0@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2/22/23 23:03, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
>> We could just do something like printing <left>_<funcname>_<right>. So
>> something like avg(reltuples / relpages) would end up as
>> avg_reltuples_float48div_relpages.
>> Whether that's worth it, or whether column name lengths would be too painful,
>> IDK.
>
> I think you'd soon be hitting NAMEDATALEN limits ...

<flameproof_suit>

Probably an unpalatable idea, but if we did something like
md5('avg(reltuples / relpages)') for the column name, it would be
(reasonably) unique and deterministic. Not pretty, but possibly useful
in some cases.

</flameproof_suit>

--
Joe Conway
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2023-02-23 13:40:38 pgsql: pg_rewind: Fix determining TLI when server was just promoted.
Previous Message Tomas Vondra 2023-02-23 12:56:13 Re: logical decoding and replication of sequences, take 2