Re: Improving inferred query column names - Mailing list pgsql-hackers

From Joe Conway
Subject Re: Improving inferred query column names
Date
Msg-id 3e734990-f5ca-27bd-d4c4-794bf7165bb0@joeconway.com
Whole thread Raw
In response to Re: Improving inferred query column names  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2/22/23 23:03, Tom Lane wrote:
> Andres Freund <andres@anarazel.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




pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: logical decoding and replication of sequences, take 2
Next
From: Heikki Linnakangas
Date:
Subject: Re: pg_rewind race condition just after promotion