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-0025im-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-002hHM-1B for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Aug 2026 09:25:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wwXLS-001Nor-1z for pgsql-bugs@lists.postgresql.org; Wed, 19 Aug 2026 03:52:07 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wwXLR-00000001KTB-2DlR for pgsql-bugs@lists.postgresql.org; Wed, 19 Aug 2026 03:52:06 +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=FBrfeRaqZQAqUHE3Cp/Rh594efQ6RIZzBNhBHhlQJf8=; b=cnmzDqSPhLSHXsqeY6JooRsfnu mMcIYGepRS5lWDlA4KiWinDlbYmrBwGFg8W67qrVdttnZLej6A4LJk/msUroIYTv+lJzwIXfBLkxc 9ox55Rnwr8Dz+gQ1aeBUnKxWQ9sxwzJmdkeeSoBpTKtAUbAefsy5CEEL2MJTWLBp7YSulrtWJp1Le 29JcrtuPS/x+ZIoXxQylV0qOp126Yy/eKQFe3USDpUyV1ycrK3JNlhvRB1rpUF8RDwT+IKMx/rHw6 uYlrOS/PypP1fl/5Vn55BB2gfwNBKVoOxKpAgmzsJsNnQ8g61bCg51AMRaXfUDv9W0wkhFKk/MZvH 8PcG7cpw==; 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-0043ri-0Z 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-0000000AXw5-0Khi 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 #19630: FOR PORTION OF crashes with XX000 when target range is NULL 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:32 +0000 Message-ID: <19630-9f10ca28426295fa@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: 19630 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 When a DELETE/UPDATE ... FOR PORTION OF receives a NULL range target, it hits elog(ERROR) without errcode() in nodeModifyTable.c, producing SQLSTATE XX000 instead of a proper error. =20 Reproducer: =20 CREATE TABLE t ( id int4range NOT NULL, valid_at daterange NOT NULL, name text NOT NULL, CONSTRAINT t_pk PRIMARY KEY (id, valid_at WITHOUT OVERLAPS) ); INSERT INTO t (id, valid_at, name) VALUES ('[1,2)', '[2018-01-02,2020-01-01)', 'one'); =20 DELETE FROM t FOR PORTION OF valid_at (NULL) WHERE id =3D '[1,2)'; -- ERROR: XX000: FOR PORTION OF target was null -- LOCATION: ExecInitModifyTable, nodeModifyTable.c:5647 =20 Expected: a proper SQLSTATE (e.g. 22004 null_value_not_allowed). Found by automated SQL fuzzing. Credit: Zheng Wang, Yanjie Zhao, Yiyang Liu