Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lX9hQ-0005Xq-8X for pgsql-bugs@arkaria.postgresql.org; Thu, 15 Apr 2021 21:38:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lX9hO-0008NA-9f for pgsql-bugs@arkaria.postgresql.org; Thu, 15 Apr 2021 21:38:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lX9hO-0008Mx-3S for pgsql-bugs@lists.postgresql.org; Thu, 15 Apr 2021 21:38:54 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lX9hL-0005mb-On for pgsql-bugs@lists.postgresql.org; Thu, 15 Apr 2021 21:38:53 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1lX9hK-0005GD-BZ; Thu, 15 Apr 2021 17:38:50 -0400 Date: Thu, 15 Apr 2021 17:38:50 -0400 From: Bruce Momjian To: jakub.zemanek@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16965: Select query fails with ERROR: XX000: could not find pathkey item to sort Message-ID: <20210415213850.GA17131@momjian.us> References: <16965-d02be1c323c94896@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16965-d02be1c323c94896@postgresql.org> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Apr 15, 2021 at 04:05:03PM +0000, PG Bug reporting form wrote: > The following bug has been logged on the website: > > Bug reference: 16965 > Logged by: Jakub Zemanek > Email address: jakub.zemanek@gmail.com > PostgreSQL version: 13.2 > Operating system: Ubuntu 20.04 > Description: > > Hi, > after upgrade of our zabbix database from v 12 to v 13, we have encountered > error in select queries. When we SET max_parallel_workers_per_gather=0; then > the query finishes without error. The query looks like this: > SELECT DISTINCT COUNT(DISTINCT t.triggerid) AS rowscount,i.hostid FROM > triggers t,functions f,items i WHERE i.hostid=10406 AND > f.triggerid=t.triggerid AND f.itemid=i.itemid AND t.flags IN (0,4) GROUP BY > i.hostid;' > ERROR: XX000: could not find pathkey item to sort > LOCATION: prepare_sort_from_pathkeys, createplan.c:6013 This issue was reported on April 12 by someone else: https://www.postgresql.org/message-id/flat/91f3ec99-85a4-fa55-ea74-33f85a5c651f%40swarm64.com A patch to fix it is being considered. You might want to watch that thread to test or apply the patch, or wait for a fix in the next minor release. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.