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.98.2) (envelope-from ) id 1xU8dN-00000000nIJ-2OBV for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Nov 2026 20:21:30 +0000 Received: from localhost ([127.0.0.1]:60592 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xU8dL-00000003SAW-2EXa for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Nov 2026 20:21:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]:37172) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xU8dL-00000003SAH-183n for pgsql-bugs@lists.postgresql.org; Thu, 19 Nov 2026 20:21:27 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xU8dJ-00000000Y9T-0rbo for pgsql-bugs@lists.postgresql.org; Thu, 19 Nov 2026 20:21:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 6AJKLJbq1127887; Thu, 19 Nov 2026 15:21:19 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 sss.pgh.pa.us 6AJKLJbq1127887 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sss.pgh.pa.us; s=default; t=1795119679; bh=AvEAKpciNvNPUQLEK78XyGGe1KMpY/+eS0JTsgOoiH4=; h=From:To:cc:Subject:In-reply-to:References:Date:From; b=0F0EHqfoaGSOXgr2pdGMNpeuMhiwh7xi/0zMxLQUCspl6JPD/+7YVbPg9rkb1pfTl 8uWz6BL7q1hbfNJDn6S4VbfOYcFLjVvZ7TskkUPa5WWmH1W8liY5NXa8cZKNnK1CKP PaC86jH/AwdMfC6+MRjBNXRUkH22y3hvtZOkvUKc= From: Tom Lane To: tharakan@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19916: UNION over hash-only and sort-only columns: could not devise a query plan In-reply-to: <19916-8097ca71b8aa4085@postgresql.org> References: <19916-8097ca71b8aa4085@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Wed, 18 Nov 2026 22:24:14 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1127884.1795119679.1@sss.pgh.pa.us> Date: Thu, 19 Nov 2026 15:21:19 -0500 Message-ID: <1127885.1795119679@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > A UNION whose columns can't all be sorted and can't all be hashed fails > with an internal error: > ERROR: XX000: could not devise a query plan for the given query > LOCATION: set_cheapest, pathnode.c:279 > tsvector has a btree opclass but no hash opclass, and aclitem has a > hash opclass but no btree one, so neither strategy works for the query > below. Up to 16 this was reported properly, and INTERSECT and EXCEPT > over the same columns still are, on every branch: Yeah, we should catch that nicely, even if it's an edge case. Will fix, thanks for the report. regards, tom lane