public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: David G. Johnston <[email protected]>
Cc: Adrian Klaver <[email protected]>
Cc: PALAYRET Jacques <[email protected]>
Cc: [email protected]
Subject: Re: PostgreSQL query with FULL OUTER JOIN and subquery using column of GROUP BY expression ERROR: subquery uses ungrouped column from outer query
Date: Wed, 25 Feb 2026 17:44:43 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<CAKFQuwY27TZSERWdmC+=RO+B86KAOSW+CeJSSL52eUZQLYZsrA@mail.gmail.com>
	<[email protected]>

I wrote:
> "David G. Johnston" <[email protected]> writes:
>> My first impression is that this is a bug.  Especially since the query
>> apparently executes in both left-join and right-join modes.

> Well, it's a longstanding deficiency anyway.
> ...
> Still, it is annoying.  I wonder if there's a way to do it without
> either a large amount of new code or exponential time spent
> trying useless subexpression matches...

I've posted a draft fix for that at

https://www.postgresql.org/message-id/flat/531183.1772058731%40sss.pgh.pa.us

			regards, tom lane






view thread (6+ messages)

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: PostgreSQL query with FULL OUTER JOIN and subquery using column of GROUP BY expression ERROR: subquery uses ungrouped column from outer query
  In-Reply-To: <[email protected]>

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

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