BUG #18398: Simplified SQL Query for Problem Diagnosis

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: akuluasan(at)163(dot)com
Subject: BUG #18398: Simplified SQL Query for Problem Diagnosis
Date: 2024-03-18 14:05:58
Message-ID: 18398-1cdfeb09832a3c82@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18398
Logged by: Heil
Email address: akuluasan(at)163(dot)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!

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2024-03-18 14:23:32 Re: Regression tests fail with musl libc because libpq.so can't be loaded
Previous Message Thomas Munro 2024-03-18 13:25:33 Re: Regression tests fail with musl libc because libpq.so can't be loaded