Re: [PATCH] json_lex_string: don't overread on bad UTF8

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: [PATCH] json_lex_string: don't overread on bad UTF8
Date: 2024-05-03 11:54:11
Message-ID: df114cad-3ee0-42ea-8ee5-d8024dfa8a75@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 30.04.24 19:39, Jacob Champion wrote:
> Tangentially: Should we maybe rethink pieces of the json_lex_string
> error handling? For example, do we really want to echo an incomplete
> multibyte sequence once we know it's bad?

I can't quite find the place you might be looking at in
json_lex_string(), but for the general encoding conversion we have what
would appear to be the same behavior in report_invalid_encoding(), and
we go out of our way there to produce a verbose error message including
the invalid data.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2024-05-03 12:20:21 Re: pg_trgm comparison bug on cross-architecture replication due to different char implementation
Previous Message Daniel Gustafsson 2024-05-03 11:53:28 Re: wrong comment in libpq.h