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.96) (envelope-from ) id 1wwcYZ-0025ik-1A for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Aug 2026 09:25:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wwcYY-002hHN-1B for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Aug 2026 09:25:58 +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.96) (envelope-from ) id 1wwXLT-001Noz-1m for pgsql-bugs@lists.postgresql.org; Wed, 19 Aug 2026 03:52:08 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wwXLS-000000003QO-2Cex for pgsql-bugs@lists.postgresql.org; Wed, 19 Aug 2026 03:52:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=+j0ifp73op5sfOl63gzWOo8vfd1yJN4R2TiD80Afgfo=; b=byZvzghI7HFAvjgOaQdVjNZ+Py gWiPNYLuFXIu75WPUvF9/ZGZJjga1iVjEqNhDIpqkcsmJwGe/WbrLSC0x41pUxgASWEJZpGixsMId wfCvcn9ApaoG0TPwNSLNvfD2xjxQ6YOzFm6A62SpoqUtx9WG+4QR0JIy8TMIq74YFCp34RzOF25XD xYqMDP2twHKRHLvrNABeiwqTKAgPvhv5FkyhTM5sxYL5jujKFNZUdM6rW/7Sqm1bJ4W2VIfHqKFlj 6YL6HpDeHR7vkNRnDES7v7sYjridmy9NImHOOklFooK5Y0XjDFQyLIgV9kyAjCJY/h9mL2qWeTrsE /ILBLFPA==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wwXLR-0043rk-0b for pgsql-bugs@lists.postgresql.org; Wed, 19 Aug 2026 03:52:05 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1wwXLQ-0000000AXw9-0RB1 for pgsql-bugs@lists.postgresql.org; Wed, 19 Aug 2026 03:52:04 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19631: currtid2() on a view with GROUP BY ctid crashes with XX000 To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: hackerzheng666@gmail.com Reply-To: hackerzheng666@gmail.com, pgsql-bugs@lists.postgresql.org Date: Wed, 19 Aug 2026 03:51:52 +0000 Message-ID: <19631-b443dd6cd8d4e40b@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following bug has been logged on the website: Bug reference: 19631 Logged by: Zheng Hacker Email address: hackerzheng666@gmail.com PostgreSQL version: 19beta3 Operating system: Linux x86_64 Description: =20 PostgreSQL version: 20devel (commit bdbf662, 2026-08-19) OS: Linux x86_64 =20 Calling currtid2() on a view whose SELECT includes ctid in a GROUP BY hits elog(ERROR) without errcode() in tid.c, producing SQLSTATE XX000. =20 Reproducer: =20 CREATE TABLE tid_tab (a int); INSERT INTO tid_tab VALUES (1); CREATE VIEW tid_view_with_ctid AS SELECT ctid, a FROM tid_tab GROUP BY ctid, a; SELECT currtid2('tid_view_with_ctid'::text, '(0,1)'::tid); -- ERROR: XX000: currtid cannot handle this view -- LOCATION: currtid_for_view, tid.c:435 =20 Note: the view has a ctid column (so it passes the tididx check at line 389 which does have a proper errcode), but the GROUP BY prevents the code from resolving the TLE to a simple base-table Var, so it falls through to the elog(ERROR) at line 435 which lacks errcode(). =20 Expected: a proper SQLSTATE (e.g. 0A000 feature_not_supported). Found by automated SQL fuzzing. Credit: Zheng Wang, Yanjie Zhao, Yiyang Liu