pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: work.michael.2956@gmail.com, PostgreSQL Bug List <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #18327: Column naming inconsistency for boolean literals in ELSE clauses of CASE expressions.
Date: Sun, 04 Feb 2024 14:57:43 -0500
Message-ID: <3934130.1707076663@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwa6pmbdMDvjzkQijaimLwXXQYTGRReT-od0y-E42EjhxQ@mail.gmail.com>
References: <18327-f25f77a50d104716@postgresql.org>
	<CAKFQuwa6pmbdMDvjzkQijaimLwXXQYTGRReT-od0y-E42EjhxQ@mail.gmail.com>

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> This is indeed all consistent in that literals don't have names while other
> expression tend to.

Actually, pre-v15 the literal constants "true" and "false" do have
names for this purpose.  For historical reasons they were parsed
into the equivalent of 't'::bool and 'f'::bool, and then the name
selection rule for a typecast took effect.

Starting in v15 they're treated like other sorts of literals,
meaning they have no assigned name:

regression=# select true;
 ?column? 
----------
 t
(1 row)

Many of these other examples change as a consequence.

			regards, tom lane





view thread (3+ messages)

Message-ID: <3934130.1707076663@sss.pgh.pa.us>
Permalink:  ../3934130.1707076663@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3934130.1707076663@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18327: Column naming inconsistency for boolean literals in ELSE clauses of CASE expressions.
  In-Reply-To: <3934130.1707076663@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox