Andrus <kobruleht2@hot.ee> writes:
> This file size is only 6.2 GB. If custom format is used, pg_dump creates
> large file without problems. There are no file size limits. Error
> message is not about this.
Are you certain that the pg_dump you're using is v15, and not something
pre-v14? We got rid of the 4GB limit on stat() results in v14,
or so we thought.
Anyway, as far as I can find pg_dump can only reach that error message
via fsync_dir_recurse(), which suggests that a workaround might be
to add --no-sync so it doesn't try to fsync its output.
regards, tom lane