postgresql/src/bin/pg_dump
Tom Lane 5f5e68b087 Adopt the GNU convention for handling tar-archive members exceeding 8GB.
The POSIX standard for tar headers requires archive member sizes to be
printed in octal with at most 11 digits, limiting the representable file
size to 8GB.  However, GNU tar and apparently most other modern tars
support a convention in which oversized values can be stored in base-256,
allowing any practical file to be a tar member.  Adopt this convention
to remove two limitations:
* pg_dump with -Ft output format failed if the contents of any one table
exceeded 8GB.
* pg_basebackup failed if the data directory contained any file exceeding
8GB.  (This would be a fatal problem for installations configured with a
table segment size of 8GB or more, and it has also been seen to fail when
large core dump files exist in the data directory.)

File sizes under 8GB are still printed in octal, so that no compatibility
issues are created except in cases that would have failed entirely before.

In addition, this patch fixes several bugs in the same area:

* In 9.3 and later, we'd defined tarCreateHeader's file-size argument as
size_t, which meant that on 32-bit machines it would write a corrupt tar
header for file sizes between 4GB and 8GB, even though no error was raised.
This broke both "pg_dump -Ft" and pg_basebackup for such cases.

* pg_restore from a tar archive would fail on tables of size between 4GB
and 8GB, on machines where either "size_t" or "unsigned long" is 32 bits.
This happened even with an archive file not affected by the previous bug.

* pg_basebackup would fail if there were files of size between 4GB and 8GB,
even on 64-bit machines.

* In 9.3 and later, "pg_basebackup -Ft" failed entirely, for any file size,
on 64-bit big-endian machines.

In view of these potential data-loss bugs, back-patch to all supported
branches, even though removal of the documented 8GB limit might otherwise
be considered a new feature rather than a bug fix.
2015-11-21 20:21:32 -05:00
..
po Translation updates 2015-11-09 10:21:11 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
common.c Add transforms feature 2015-04-26 10:33:14 -04:00
compress_io.c Restore use of zlib default compression in pg_dump directory mode. 2015-07-25 17:15:32 -04:00
compress_io.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
dumputils.c Use FLEXIBLE_ARRAY_MEMBER in a bunch more places. 2015-02-20 00:11:42 -05:00
dumputils.h Use FLEXIBLE_ARRAY_MEMBER in a bunch more places. 2015-02-20 00:11:42 -05:00
keywords.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
Makefile Update copyright for 2015 2015-01-06 11:43:47 -05:00
nls.mk Add missing source files to nls.mk 2014-07-15 10:10:42 -04:00
parallel.c Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
parallel.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
pg_backup.h Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
pg_backup_archiver.c pg_dump: Fix some messages 2015-09-27 20:34:40 -04:00
pg_backup_archiver.h Add macros wrapping all usage of gcc's __attribute__. 2015-03-11 14:30:01 +01:00
pg_backup_custom.c pg_dump: Reduce use of global variables 2014-10-14 15:00:55 -03:00
pg_backup_db.c Replace a bunch more uses of strncpy() with safer coding. 2015-01-24 13:05:42 -05:00
pg_backup_db.h pg_dump: Reduce use of global variables 2014-10-14 15:00:55 -03:00
pg_backup_directory.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
pg_backup_null.c pg_dump: Reduce use of global variables 2014-10-14 15:00:55 -03:00
pg_backup_tar.c Adopt the GNU convention for handling tar-archive members exceeding 8GB. 2015-11-21 20:21:32 -05:00
pg_backup_tar.h Fix tar files emitted by pg_dump and pg_basebackup to be POSIX conformant. 2012-09-28 15:19:15 -04:00
pg_backup_utils.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
pg_backup_utils.h Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
pg_dump.c ALTER TABLE .. FORCE ROW LEVEL SECURITY 2015-10-04 21:05:18 -04:00
pg_dump.h ALTER TABLE .. FORCE ROW LEVEL SECURITY 2015-10-04 21:05:18 -04:00
pg_dump_sort.c pg_dump: Fix some messages 2015-09-27 20:34:40 -04:00
pg_dumpall.c pg_dump, pg_upgrade: allow postgres/template1 tablespace moves 2015-09-11 15:51:11 -04:00
pg_restore.c Review program help output for wording and formatting 2015-09-16 00:37:39 -04:00