From: s.reiser@tu-bs.de
To: pgsql-bugs@postgresql.org
Subject: BUG #7794: pg_dump: errors when using pipes/streams
Date: Sun, 06 Jan 2013 20:09:34 +0000
Message-ID: <E1TrwXG-0005p0-Vb@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 7794
Logged by: Stefan Reiser
Email address: s.reiser@tu-bs.de
PostgreSQL version: 9.1.7
Operating system: Windows 7 Pro 64-Bit
Description:
I intend to stream the output of pg_dump into a zip file (along with some
other files and comments).
pg_dump shows one or more warnings when used with non-seekable streams:
"pg_dump: [custom archiver] WARNING: ftell mismatch with expected position
-- ftell used"
Examples (on Windows 7 Pro 64 Bit, PG 9.1.7 and 9.1.6, 64 Bit)
1) pg_dump --format=custom --schema-only mydatabase | zip -0 TEST.ZIP -
2) pg_dump --format=custom --schema-only mydatabase > NUL
3) pg_dump --format=custom --schema-only --file TEST3 mydatabase
4) pg_dump --format=custom --schema-only mydatabase > TEST4
1 and 2 print warnings, while pg_dump's exit code is 0 (as can be verified
with example 2),
3 and 4 are ok.
I've used "--schema-only" to emphasize that it's not a question of file size
(without "--schema-only" the number of warnings increases, supposedly one
per table).
The "zip" in example 1 is Info-ZIP 3.0 - but you can as well use anything
that consumes STDIN, like gzip, ...)
Files TEST3 and TEST4 are of the same size, the file packaged in TEST.ZIP is
slightly bigger.
With all three generated files pg_restore produces exactly the same script,
so the backup seems ok - but why the warnings then? (And what do they mean,
anyway?) Are those backups reliable or could they as well become corrupted?
(after all, it seems pg_dump wants to write something somewhere for some
reason, but can't...)
A similar problem has been reported as "BUG #6726"
(http://archives.postgresql.org/pgsql-bugs/2012-07/msg00074.php) but I
couldn't find any replies ... so I filed this new report.
(Formats tar and plain don't seem to produce these warnings, so I'll work
around the problem by using the tar format.)
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: s.reiser@tu-bs.de
Subject: Re: BUG #7794: pg_dump: errors when using pipes/streams
In-Reply-To: <E1TrwXG-0005p0-Vb@wrigleys.postgresql.org>
References: <E1TrwXG-0005p0-Vb@wrigleys.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