pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: tomas.dalebjork@gmail.com
Subject: BUG #16842: pg_dump uses seek calls on pipe files: suggesting adding a flag to disable seek calls
Date: Thu, 28 Jan 2021 12:19:52 +0000
Message-ID: <16842-381bd64d2f0f68db@postgresql.org> (raw)

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



view thread (4+ messages)  latest in thread

Message-ID: <16842-381bd64d2f0f68db@postgresql.org>
Permalink:  ../16842-381bd64d2f0f68db@postgresql.org/
Also on:    postgresql.org/message-id/16842-381bd64d2f0f68db@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, tomas.dalebjork@gmail.com
  Subject: Re: BUG #16842: pg_dump uses seek calls on pipe files: suggesting adding a flag to disable seek calls
  In-Reply-To: <16842-381bd64d2f0f68db@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox