The following bug has been logged on the website:
Bug reference: 16842
Logged by: Tomas Dalebjörk
Email address: tomas.dalebjork@gmail.com
PostgreSQL version: 13.0
Operating system: SuSE 15
Description:
pg_dump is trying to identify the type of device used for output.
This is done in a way that it checks that filedescriptor to check if this
supports seek calls etc.
A redirect is a clone of the targeted filedescriptor, which will results in
that the pg_dump utility will enable seek calls.
https://searchcode.com/file/47798353/src/bin/pg_dump/pg_backup_custom.c/
It would be good to add a flag to disable this feature, as some devices does
not support seek calls, for example streaming devices such as a tape
drive.
From Red Hat:
# pg_dump > pgdump.bkp
"That's not a pipe; it's a redirect. The program's stdout (fd=1) will be for
that file, and they can still perform seek operations on it. An fstat(2) on
that file descriptor will show it as a regular file, not a character device
(tty) or a fifo (pipe)."
You could try this instead:
pg_dump | cat > /myfs/testfile.out"
Not sure if this is limited to when --format=custom is used?
It can be worth trying to use pg_dump without the --format=custom option
A restore from pg_dump can't be loaded using pg_restore if --format=custom
is left out (if I recall), but it can be loaded using "psql < dumpfile"
Suggestions for how to avoid seek calls using pg_dump?
Is the seek calls only applicable when --format=custom is used?
Regards Tomas