> On Nov 18, 2026, at 02:27, Haibo Yan <[email protected]> wrote:
> 
> Hi Chao,
> 
> Thanks for reviewing. I haven't found a case where normal writes or
> a crash left an embedded NUL in pg_stash_advice.tsv. The writer uses a
> temporary file and durable_rename(), and SQL text input rejects NUL
> even with SQL_ASCII. I inserted the NUL by hand for the test.
> 
> Other byte changes can go undetected. NUL is worth checking because
> the loader mistakes it for EOF, reports success, and can discard the
> remaining records on the next save.
> 
> Best regards,
> Haibo

If this is defensive handling of a manually corrupted file, then the same 
concern may apply to many other text file readers. In that case, instead of 
adding a check specifically for the stash file, maybe a better way is to add a 
generic text file reader to handle all possible errors in a single place.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/






Reply via email to