Re: No error checking when reading from file using zstd in pg_dump

Daniel Gustafsson <daniel@yesql.se>

From: Daniel Gustafsson <daniel@yesql.se>
To: Tomas Vondra <tomas@vondra.me>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Evgeniy Gorbanev <gorbanyoves@basealt.ru>, pgsql-hackers@lists.postgresql.org
Date: 2025-06-16T20:49:54Z
Lists: pgsql-hackers
> On 16 Jun 2025, at 21:45, Tomas Vondra <tomas@vondra.me> wrote:

> Regarding the Z_NULL, I believe it has always been ignored like this, at
> least since 9.1. The code simply returns what gzgets() returns, and then
> compares that to NULL, etc. Is there there's a better way to deal with
> Z_NULL? I suppose we could explicitly check/translate Z_NULL to NULL,
> although Z_NULL is simply defined as 0. I don't recall if NULL has some
> additional magic.

Right, to be clear, I don't think there is a bug here (or the risk one going
forward).  It's just my own preference of not mixing API concepts

--
Daniel Gustafsson




Commits

  1. pg_dump: Fix compression API errorhandling