agora inbox for pgsql-bugs@postgresql.org
help / color / mirror / Atom feedFrom: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: hackerzheng666@gmail.com
Subject: BUG #19631: currtid2() on a view with GROUP BY ctid crashes with XX000
Date: Wed, 19 Aug 2026 03:51:52 +0000
Message-ID: <19631-b443dd6cd8d4e40b@postgresql.org> (raw)
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:
PostgreSQL version: 20devel (commit bdbf662, 2026-08-19)
OS: Linux x86_64
Calling currtid2() on a view whose SELECT includes ctid in a GROUP BY
hits elog(ERROR) without errcode() in tid.c, producing SQLSTATE XX000.
Reproducer:
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
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().
Expected: a proper SQLSTATE (e.g. 0A000 feature_not_supported).
Found by automated SQL fuzzing.
Credit: Zheng Wang, Yanjie Zhao, Yiyang Liu
view thread (6+ messages) latest in thread
Message-ID: <19631-b443dd6cd8d4e40b@postgresql.org>
Permalink: ../19631-b443dd6cd8d4e40b@postgresql.org/
Also on: postgresql.org/message-id/19631-b443dd6cd8d4e40b@postgresql.org
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: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, hackerzheng666@gmail.com
Subject: Re: BUG #19631: currtid2() on a view with GROUP BY ctid crashes with XX000
In-Reply-To: <19631-b443dd6cd8d4e40b@postgresql.org>
* 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