pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: ivningman@gmail.com
Subject: BUG #18542: Order by expression, that contains column from projection isn't working
Date: Tue, 16 Jul 2024 09:12:36 +0000
Message-ID: <18542-adf5273ccfea5558@postgresql.org> (raw)

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



view thread (2+ messages)  latest in thread

Message-ID: <18542-adf5273ccfea5558@postgresql.org>
Permalink:  ../18542-adf5273ccfea5558@postgresql.org/
Also on:    postgresql.org/message-id/18542-adf5273ccfea5558@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, ivningman@gmail.com
  Subject: Re: BUG #18542: Order by expression, that contains column from projection isn't working
  In-Reply-To: <18542-adf5273ccfea5558@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox