Skip to content

v2.2.0

Choose a tag to compare

@gmr gmr released this 01 Sep 00:55
· 17 commits to main since this release
6dde1b4

What's Changed

Archives written by libpgdump could not be read by pg_restore in directory or tar format, and archives rewritten in any format were rejected by pg_restore before PostgreSQL 12. Anyone writing archives should upgrade.

Fixed

  • Directory and tar writers stored a NULL extra-TOC filename for entries with no data file. pg_dump writes an empty string, and pg_restore's _ReadExtraToc calls strlen() on it, so every directory or tar archive we wrote crashed pg_restore — including pg_restore -l (#12)
  • Tar members were written in filename order. pg_restore reads tar archives sequentially and rejected data members that came before the member of an earlier TOC entry, failing restores partway with "restoring data out of order is not supported in this archive format" (#12)
  • The directory writer renamed blob TOC files, which pg_restore 16 and earlier reject, and blob TOC filenames read from an archive are now rejected if they escape the output directory (#12)
  • read_string() collapsed empty strings to NULL. pg_dump writes "" for fields such as an entry's owner and drop statement, and pg_restore before PostgreSQL 12 calls strlen() on them with no NULL check, so rewritten archives segfaulted those versions in all three formats (#13)
  • set_compression() left the archive version alone, so selecting lz4 or zstd on an archive older than 1.15 — the version pg_dump 15 and earlier writes — failed with UnsupportedCompression. It now raises the version to 1.15, which added nothing but the compression-algorithm byte (#13)

Added

  • tar::read_metadata() reads a tar archive's header and TOC while seeking past the data members. pgdump-toc uses it, and no longer refuses tar archives with "unsupported format: 3" (#13)
  • Compressed data support in CustomReader::read_entry_reader() (#7), and a pgdump-toc CLI for inspecting an archive's header and TOC (#8), both by @NickCrews

Changed

  • Empty strings now read as Some("") rather than None. Entry fields such as owner, drop_stmt, and tablespace carry the distinction pg_dump makes between an empty string and NULL, so code matching on None for those fields may need updating
  • CI now tests against PostgreSQL 13 through 18, up from 16 through 18, and archives written by libpgdump are checked with a real pg_restore across every format and compression algorithm

Internal

  • Timestamp, Blob, and ArchiveData moved to types.rs, with read_timestamp()/write_timestamp() deduplicated (#9), and per-chunk allocation removed from the data reader (#7), both by @NickCrews

Full Changelog: v2.1.0...v2.2.0