Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9MtT-001lwr-S7 for pgsql-bugs@arkaria.postgresql.org; Tue, 21 May 2024 10:38:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s9MtT-0098up-PK for pgsql-bugs@arkaria.postgresql.org; Tue, 21 May 2024 10:38:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9MtT-0098uh-Eo for pgsql-bugs@lists.postgresql.org; Tue, 21 May 2024 10:38:55 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9MtQ-0001Gp-VQ for pgsql-bugs@postgresql.org; Tue, 21 May 2024 10:38:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description; bh=rMrafs9oC5apXHsFthO1kyEZrweu8X+2hZqAKYK4jDs=; b=fyorj3mYN7J5OCpRkD27qQSDFo Yb9JnPNNvZMVqLkX58D3+QpUT0GO6IFTv+5cBWM/whVE1P499o5DRPkLA1WejVaWLew91zHr54xhu wX0ZWEt5xQvHcz1JdoZ4iK3ZIQEEZBSuP8fVxQKsBNultJBMR397y708+0Vxu/B2TLrc=; Received: from depesz by depesz.com with local (Exim 4.96) (envelope-from ) id 1s9MtP-004IGh-2L; Tue, 21 May 2024 12:38:51 +0200 Date: Tue, 21 May 2024 12:38:51 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: David Rowley Cc: pgsql-bugs mailing list Subject: Re: UNION removes almost all rows (not duplicates) - in fresh build of pg17! Message-ID: Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, May 21, 2024 at 09:54:25AM +1200, David Rowley wrote: > Thanks for the report. > It looks like it's a very simple fix. The problem is I wasn't setting > groupList when the grouping_is_sortable() returned false. In the > prior version, make_union_unique() always set that. > The attached should apply cleanly up to d2a04470a. Hi, tested, and can confirm that applying this patch on top of d2a04470aa6401c1938cc107e0b2c56c22a2321f solved the problem. Best regards, depesz