BUG #18170: Unexpected error: no relation entry for relid 3 - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #18170: Unexpected error: no relation entry for relid 3
Date
Msg-id 18170-f1d17bf9a0d58b24@postgresql.org
Whole thread Raw
Responses Re: BUG #18170: Unexpected error: no relation entry for relid 3  (Vik Fearing <vik@postgresfriends.org>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18170
Logged by:          Zuming Jiang
Email address:      zuming.jiang@inf.ethz.ch
PostgreSQL version: 16.0
Operating system:   Ubuntu 20.04
Description:

My fuzzer finds a bug in Postgres, which triggers an unexpected error.

--- Set up database ---
create table t0 (c1 text, c5 text, c6 text);
create table t2 (vkey int4, c17 text, primary key(vkey));
------------------------

The fuzzer generates a test case:

--- Test case ---
select  
  rtrim(ref_4.c6, ref_2.c17) as c_0
from 
  (t0 as ref_0
    inner join ((t0 as ref_1
        full outer join (t2 as ref_2
          right outer join t2 as ref_3
          on (ref_2.vkey = ref_3.vkey))
        on (ref_1.c1 = ref_2.c17))
      left outer join t0 as ref_4
      on (ref_1.c5 = ref_4.c1))
    on (ref_0.c6 = ref_4.c1))
except all
select ref_6.c17 as c_0 from t2 as ref_6;
------------------------

--- Expected behavior ---
The test case should not trigger any error.

--- Actual behavior ---
The test case trigger an error: 

ERROR:  no relation entry for relid 3

--- Postgres version ---
Github commit: 26f988212eada9c586223cbbf876c7eb455044d9
Version: PostgreSQL 17devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu
9.4.0-1ubuntu1~20.04.2) 9.4.0, 64-bit

--- Platform information ---
Platform: Ubuntu 20.04
Kernel: Linux 5.4.0-147-generic


pgsql-bugs by date:

Previous
From: Amit Langote
Date:
Subject: Re: AW: AW: BUG #18147: ERROR: invalid perminfoindex 0 in RTE with relid xxxxx
Next
From: PG Bug reporting form
Date:
Subject: BUG #18171: Dropping an index on a partitioned table drops all child indices even with a restrict