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: rekgrpth@gmail.com
Subject: BUG #17916: Expression IN list translates to unqualified operator
Date: Wed, 03 May 2023 05:19:07 +0000
Message-ID: <17916-8d713fd64529da21@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17916
Logged by:          RekGRpth
Email address:      rekgrpth@gmail.com
PostgreSQL version: 15.2
Operating system:   alpine in docker
Description:        

```sql
create schema qwe;
create or replace function qwe.chartexteq(a char, b text) returns boolean
language plpgsql as $$begin perform 1/0;return true;end;$$;
create operator qwe.= (leftarg = char, rightarg = text, function =
qwe.chartexteq, commutator = operator(qwe.=), hashes, merges);
set search_path = qwe;
explain (costs off, verbose on) select i from generate_series(1, 10) i where
i::char in (2::text);
                  QUERY PLAN                   
-----------------------------------------------
 Function Scan on pg_catalog.generate_series i
   Output: i
   Function Call: generate_series(1, 10)
   Filter: ((i.i)::character(1) = '2'::text)
 Query Identifier: -7727870581584713193
(5 rows)
select i from generate_series(1, 10) i where i::char in (2::text);
ERROR:  division by zero
CONTEXT:  SQL statement "SELECT 1/0"
PL/pgSQL function chartexteq(character,text) line 1 at PERFORM
```
I expected, that IN list translates to pg_catalog.=



view thread (4+ messages)  latest in thread

Message-ID: <17916-8d713fd64529da21@postgresql.org>
Permalink:  ../17916-8d713fd64529da21@postgresql.org/
Also on:    postgresql.org/message-id/17916-8d713fd64529da21@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, rekgrpth@gmail.com
  Subject: Re: BUG #17916: Expression IN list translates to unqualified operator
  In-Reply-To: <17916-8d713fd64529da21@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