agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix spurious errors in COPY FROM (FORMAT {text,csv}).
Date: Tue, 01 Sep 2026 19:21:46 +0000
Message-ID: <E1x1U3F-000000034qV-0enF@gemulon.postgresql.org> (raw)
Fix spurious errors in COPY FROM (FORMAT {text,csv}).
The SIMD path for these commands reads ahead into the input buffer
via CopyLoadInputBuf(), which reports encoding and conversion
errors. The problem is that the errant data might lie beyond the
end-of-copy marker, which we aren't copying and thus needn't error
for. To fix, add a "speculative" parameter to CopyLoadInputBuf()
that defers these errors, and use it in the SIMD path. The errors
are instead reported only if we actually reach the errant data.
Testing indicates this does not meaningfully impact performance.
Oversight in commit e0a3a3fd53.
Reviewed-by: Greg Burd <greg@burd.me>
Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com>
Discussion: https://postgr.es/m/apWOr1kgVSqweBnU%40nathan
Backpatch-through: 19
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/f26ab219e28ceb88b29f9165800879548dcc6646
Modified Files
--------------
src/backend/commands/copyfromparse.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
view thread (2+ messages)
Message-ID: <E1x1U3F-000000034qV-0enF@gemulon.postgresql.org>
Permalink: ../E1x1U3F-000000034qV-0enF@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1x1U3F-000000034qV-0enF@gemulon.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-committers@postgresql.org
Cc: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix spurious errors in COPY FROM (FORMAT {text,csv}).
In-Reply-To: <E1x1U3F-000000034qV-0enF@gemulon.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