Re: multi-row INSERT broken with a sublink in a target column subscript

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: Amit Langote <amitlangote09(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: multi-row INSERT broken with a sublink in a target column subscript
Date: 2026-11-04 03:06:41
Message-ID: CAGRkXqQLAxzHDsgpfoQyWrPagC=9uY4L3xL3t2fw7grL+GEU7A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Amit,

The fix looks right to me. One small thing in the test. Both
subscripts evaluate to 1, so it only sets f2[1]. Maybe use
(1 IS NOT NULL)::int + 1 and add RETURNING f2, so the output
shows both elements:

insert into inserttest (f2[(select 1)], f2[(1 IS NOT NULL)::int + 1])
values (9,10), (11,12) returning f2;

Thanks,
Shihao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Henson Choi 2026-11-04 03:10:35 Re: Row pattern recognition
Previous Message shihao zhong 2026-11-04 02:48:15 Re: Emptying oauth_validator_libraries doesn't stop OAuth logins