Re: Unused CTE affects result set - Mailing list pgsql-general

From Tom Lane
Subject Re: Unused CTE affects result set
Date
Msg-id 674667.1700246934@sss.pgh.pa.us
Whole thread Raw
In response to Re: Unused CTE affects result set  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Adrian Klaver <adrian.klaver@aklaver.com> writes:
> On 11/17/23 10:30 AM, Gabriel Sánchez wrote:
>> I don't understand why the presence of a CTE that ends up not being 
>> included in the final query affects the result set. Could this be a 
>> bug, or is there something I don't understand?

> I would say it has to do with what '...' is doing?

We'd need to see a complete example to do more than speculate.
The planner definitely does skip unreferenced SELECT CTEs, though.

            regards, tom lane



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Unused CTE affects result set
Next
From: Juan Rodrigo Alejandro Burgos Mella
Date:
Subject: Re: Trigger to Count Number of Logical Replication Table Changes.