BUG #19464: Server crash (SIGABRT) with UPDATE containing multiple multi-column assignments
The following bug has been logged on the website:
Bug reference: 19464
Logged by: chunling qin
Email address: 303677365@qq.com
PostgreSQL version: 14.0
Operating system: centos
Description:
This issue could not be reproduced with the latest version, but we can
easily reproduced by PostgreSQL 14devel. I am submitting this report for
official confirmation.
postgres=# CREATE TABLE t1 (a int, b int);
UPDATE t1
SET (a) = (SELECT 1), -- subquery single-column assignment
b = 2, -- single-column assignment
(a) = ROW(1); ERROR: relation "t1" already exists
postgres=# postgres=# postgres-# postgres-# postgres-#
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
postgres=#
postgres=# select version();
version
--------------------------------------------------------------------------------------
-------------------------------------------------
PostgreSQL 14devel on x86_64-pc-linux-gnu, compiled by clang version 17.0.6
(TencentO
S 17.0.6-8.tl4.ap.2), 64-bit (commit:86dc90056d)
(1 row)
Minimal Reproduction:
```
CREATE TABLE t1 (a int, b int);
UPDATE t1
SET (a) = (SELECT 1), -- subquery single-column assignment
b = 2, -- single-column assignment
(a) = ROW(1); -- ROW constructor single-column assignment
```
Crash Summary
The server terminates with SIGABRT due to a failed assertion:
TRAP: FailedAssertion("pstate->p_multiassign_exprs == NIL", File:
"parse_target.c",
Line: 277, PID: 2398140)
Version
- Git commit: 86dc90056dfdbd9d1b891718d2e5614e3e432f35
- Version string: PostgreSQL 14devel (commit 86dc90056d, "Rework planning
and
execution of UPDATE and DELETE.")
- Platform: x86_64-pc-linux-gnu, compiled by clang 17.0.6, 64-bit
- Build config: enable_debug=yes, CFLAGS includes -g -O0, asserts enabled
Full Backtrace
#0 __pthread_kill_implementation () from /lib64/libc.so.6
#1 raise () from /lib64/libc.so.6
#2 abort () from /lib64/libc.so.6
#3 ExceptionalCondition (conditionName="pstate->p_multiassign_exprs ==
NIL",
errorType="FailedAssertion",
fileName="parse_target.c", lineNumber=277)
at assert.c:69
#4 transformExpressionList (pstate=..., exprlist=...,
exprKind=EXPR_KIND_UPDATE_SOURCE,
allowDefault=true)
at parse_target.c:277
#5 transformRowExpr (pstate=..., r=..., allowDefault=true)
at parse_expr.c:2086
#6 transformMultiAssignRef (pstate=..., maref=...)
at parse_expr.c:1454
#7 transformExprRecurse (pstate=..., expr=...)
at parse_expr.c:212
#8 transformExpr (pstate=..., expr=..., exprKind=EXPR_KIND_UPDATE_SOURCE)
at parse_expr.c:104
#9 transformTargetEntry (pstate=..., node=..., ...)
at parse_target.c:95
#10 transformTargetList (pstate=..., targetlist=...,
exprKind=EXPR_KIND_UPDATE_SOURCE)
at parse_target.c:183
#11 transformUpdateTargetList (pstate=..., origTlist=...)
at analyze.c:2308
#12 transformUpdateStmt (pstate=..., stmt=...)
at analyze.c:2283
#13 transformStmt (pstate=..., parseTree=...)
at analyze.c:295
#14 transformOptionalSelectInto (pstate=..., parseTree=...)
at analyze.c:250
#15 transformTopLevelStmt (pstate=..., parseTree=...)
at analyze.c:200
#16 parse_analyze (parseTree=..., sourceText="UPDATE t1 SET (a) = (SELECT
1), b = 2,
(a) = ROW(1);", ...)
at analyze.c:120
#17 pg_analyze_and_rewrite (...)
at postgres.c:637
#18 exec_simple_query (query_string="UPDATE t1 SET (a) = (SELECT 1), b =
2, (a) =
ROW(1);")
at postgres.c:1101
#19 PostgresMain (...)
at postgres.c:4415
#20 main (argc=5, argv=...)
at main.c:205
Dear Chunling,
Thanks for reporting issues.
This issue could not be reproduced with the latest version, but we can
easily reproduced by PostgreSQL 14devel. I am submitting this report for
official confirmation.
To confirm, can it happen on the latest PG14 (14.22)? It's the old development
version which should not be used. Same things can be said for other reports.
Best regards,
Hayato Kuroda
FUJITSU LIMITED
Hi Developer,
Thanks for the reply. I have verified this on PG 14.22 and can confirm that the issue is not reproducible on 14.22—it returns the expected error:
ERROR: multiple assignments to same column "a"
Best regards,
Chunling
------------------ 原始邮件 ------------------
发件人: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>;
发送时间: 2026年4月21日(星期二) 晚上8:20
收件人: "飞鱼"<303677365@qq.com>;"pgsql-bugs@lists.postgresql.org"<pgsql-bugs@lists.postgresql.org>;
主题: RE: BUG #19464: Server crash (SIGABRT) with UPDATE containing multiple multi-column assignments
Dear Chunling,
Thanks for reporting issues.
> This issue could not be reproduced with the latest version, but we can
> easily reproduced by PostgreSQL 14devel. I am submitting this report for
> official confirmation.
To confirm, can it happen on the latest PG14 (14.22)? It's the old development
version which should not be used. Same things can be said for other reports.
Best regards,
Hayato Kuroda
FUJITSU LIMITED
Dear 飞鱼,
Thanks for the quick confirmation. I suggest you to confirm the same for other reports [1]/messages/by-id/19461-8d03395b71f86664@postgresql.org, [2]/messages/by-id/19462-563c85bec169995a@postgresql.org and [3]/messages/by-id/19463-f59d5d2a41969756@postgresql.org.
[1]: /messages/by-id/19461-8d03395b71f86664@postgresql.org
[2]: /messages/by-id/19462-563c85bec169995a@postgresql.org
[3]: /messages/by-id/19463-f59d5d2a41969756@postgresql.org
Best regards,
Hayato Kuroda
FUJITSU LIMITED
Hi Developer,
Thanks for the quick reply. I have also verified the other three bugs on PG 15.17, and none of them are reproducible either. These issues appear to be specific to the build environment based on merge commit 7103ebb7aa and update commit 86dc9005, which is the exact version I used for commit-level testing. They seem to be tied to the transient state of the code at that particular commit—subsequent releases likely fixed or refactored the relevant code paths.
Best regards,
Chunling
------------------ 原始邮件 ------------------
发件人: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>;
发送时间: 2026年4月21日(星期二) 晚上9:00
收件人: "飞鱼"<303677365@qq.com>;
抄送: "pgsql-bugs@lists.postgresql.org"<pgsql-bugs@lists.postgresql.org>;
主题: RE: 回复:RE: BUG #19464: Server crash (SIGABRT) with UPDATE containing multiple multi-column assignments
Dear 飞鱼,
Thanks for the quick confirmation. I suggest you to confirm the same for other reports [1]/messages/by-id/19461-8d03395b71f86664@postgresql.org, [2]/messages/by-id/19462-563c85bec169995a@postgresql.org and [3]/messages/by-id/19463-f59d5d2a41969756@postgresql.org.
[1]: /messages/by-id/19461-8d03395b71f86664@postgresql.org
[2]: /messages/by-id/19462-563c85bec169995a@postgresql.org
[3]: /messages/by-id/19463-f59d5d2a41969756@postgresql.org
Best regards,
Hayato Kuroda
FUJITSU LIMITED