BUG #18398: Simplified SQL Query for Problem Diagnosis - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #18398: Simplified SQL Query for Problem Diagnosis
Date
Msg-id 18398-1cdfeb09832a3c82@postgresql.org
Whole thread Raw
Responses [MASSMAIL] 回复:BUG #18398: Simplified SQL Query for Problem Diagnosis  ("1724647576" <1724647576@qq.com>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18398
Logged by:          Heil
Email address:      akuluasan@163.com
PostgreSQL version: 16.2
Operating system:   ubuntu 20.04
Description:

I attempting to execute a complex SQL query from BUG #18305. To make it
easier to diagnose and fix the issue, I have  simplified the original query.
The simplified query is intended to replicate the behavior that leads to the
system error, allowing us to focus on the core issue without  getting lost
in the complexity of the original query.

-----Original reproduce step:-----

--- Set up database ---
create table exeet_t3 (pkey int4);
create view exeet_t8 as 
select  
    ntile(exeet_subq_0.c_0) over () as c_0 
  from 
    (select (select pkey from exeet_t3 order by pkey limit 1 offset 6) as
c_0) as exeet_subq_0;


--- Test case ---
select  
    1 as c_1
  from 
    exeet_t8 as exeet_ref_17
  where exeet_ref_17.c_0 < 0;

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

ERROR:  WindowFunc not found in subplan target lists





-----Minimal reproduce step:-----

--- Set up database ---
create table exeet_t3 (pkey int4);
create view exeet_t8 as 
select  
    ntile(exeet_subq_0.c_0) over () as c_0 
  from 
    (select (select pkey from exeet_t3) as
c_0) as exeet_subq_0;


--- Test case ---
select  
    1 as c_1
  from 
    exeet_t8 as exeet_ref_17
  where exeet_ref_17.c_0 < 0;

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

ERROR:  WindowFunc not found in subplan target lists

I kindly request the development team to examine this  simplified query to
identify the root cause of the BUG #18305 and fix the  issue as soon as
possible. By the way, please let me know if  this  simplified query is
useful.I believe that by analyzing and fixing this simplified query, you can
more easily locate the problem in the original  complex query.

Thank you for your hard work and support!


pgsql-bugs by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Regression tests fail with musl libc because libpq.so can't be loaded
Next
From: Tom Lane
Date:
Subject: Re: Regression tests fail with musl libc because libpq.so can't be loaded