Обсуждение: BUG #18398: Simplified SQL Query for Problem Diagnosis

Поиск
Список
Период
Сортировка

BUG #18398: Simplified SQL Query for Problem Diagnosis

От
PG Bug reporting form
Дата:
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!


[MASSMAIL] 回复:BUG #18398: Simplified SQL Query for Problem Diagnosis

От
"1724647576"
Дата:
Yes, I think it may be quite useful.


------------------ 原始邮件 ------------------
发件人: "PG Bug reporting form"<noreply@postgresql.org>;
发送时间: 2024年3月18日(星期一) 晚上10:05
收件人: "pgsql-bugs"<pgsql-bugs@lists.postgresql.org>;
抄送: "akuluasan"<akuluasan@163.com>;
主题: BUG #18398: Simplified SQL Query for Problem Diagnosis

/* 邮件内部图片支持调起预览。 */img[image-inside-content='1'] {cursor: pointer;}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!

.qmbox style, .qmbox script, .qmbox head, .qmbox link, .qmbox meta {display: none !important;}