Re: confusing `case when` column name - Mailing list pgsql-hackers

From Tom Lane
Subject Re: confusing `case when` column name
Date
Msg-id 1670513.1710253152@sss.pgh.pa.us
Whole thread Raw
In response to Re: confusing `case when` column name  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: confusing `case when` column name
List pgsql-hackers
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tuesday, March 12, 2024, adjkldd@126.com <winterloo@126.com> wrote:
>> Nee we change the title of the case-when output column?

> Choosing either a or b as the label seems wrong and probably worth changing
> to something that has no meaning and encourages the application of a column
> alias.

Yeah, we won't get any kudos for changing a rule that's stood for
25 years, even if it's not very good.  This is one of the places
where it's just hard to make a great choice automatically, and
users are probably going to end up applying an AS clause most of
the time if they care about the column name at all.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Jelte Fennema-Nio
Date:
Subject: Re: [EXTERNAL] Re: Add non-blocking version of PQcancel
Next
From: Robert Haas
Date:
Subject: Re: On disable_cost