BUG #18542: Order by expression, that contains column from projection isn't working - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #18542: Order by expression, that contains column from projection isn't working
Date
Msg-id 18542-adf5273ccfea5558@postgresql.org
Whole thread Raw
Responses Re: BUG #18542: Order by expression, that contains column from projection isn't working
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18542
Logged by:          Aleksandr Novozhilov
Email address:      ivningman@gmail.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


pgsql-bugs by date:

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