pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: andreas@proxel.se
Subject: BUG #17452: IN caluse behaves differently when there is one item comapred to when multiple
Date: Thu, 31 Mar 2022 13:42:05 +0000
Message-ID: <17452-d10a023545015922@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17452
Logged by:          Andreas Karlsson
Email address:      andreas@proxel.se
PostgreSQL version: 14.2
Operating system:   Linux and Mac at least
Description:        

Hi,

I noticed that the optimization (in transformAExprIn()) for the case where
there is an IN (...) with only one item breaks certain queries. Of course it
is also possible that it is the single-item case which is correct and the
multiple-item case which is broken. The case where I found this behavior was
caused by the casting rules around the reg* types but there could be other
similar issues.

Here is a simplified example based on a real query:

# SELECT version();
                                                        version             
                                           
------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 14.2 (Debian 14.2-1.pgdg120+1+b2) on x86_64-pc-linux-gnu,
compiled by gcc (Debian 11.2.0-18) 11.2.0, 64-bit
(1 row)

# SELECT 'version'::regproc IN ('version');
ERROR:  invalid input syntax for type oid: "version"
LINE 1: SELECT 'version'::regproc IN ('version');
                                      ^
# SELECT 'version'::regproc IN ('version', 'version');
 ?column? 
----------
 t
(1 row)

Best regards,
Andreas



view thread (2+ messages)  latest in thread

Message-ID: <17452-d10a023545015922@postgresql.org>
Permalink:  ../17452-d10a023545015922@postgresql.org/
Also on:    postgresql.org/message-id/17452-d10a023545015922@postgresql.org

 · 

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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, andreas@proxel.se
  Subject: Re: BUG #17452: IN caluse behaves differently when there is one item comapred to when multiple
  In-Reply-To: <17452-d10a023545015922@postgresql.org>

* 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