BUG #18542: Order by expression, that contains column from projection isn't working

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: ivningman(at)gmail(dot)com
Subject: BUG #18542: Order by expression, that contains column from projection isn't working
Date: 2024-07-16 09:12:36
Message-ID: 18542-adf5273ccfea5558@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: 18542
Logged by: Aleksandr Novozhilov
Email address: ivningman(at)gmail(dot)com
PostgreSQL version: 16.1
Operating system: Windows
Description:

select z as y from
(select 1 as z) x
order by y + 1
That query finishes with error:
ERROR: column "y" does not exist
Position: 48
But wrapping it with select works fine:
select * from (select z as y from
(select 1 as z) x) c
order by y + 1

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Etsuro Fujita 2024-07-16 10:29:16 Re: BUG #17889: Invalid cursor direction for a foreign scan that reached the fetch_size (MOVE BACKWARD ALL IN cX)
Previous Message Tender Wang 2024-07-16 07:39:12 Re: BUG #18371: There are wrong constraint residues when detach hash partiton concurrently