Skip to content

test/compose.yaml double-compresses backups via pg_dump -Z1 #3

Description

@MaikelH

Problem

test/compose.yaml sets:

POSTGRES_EXTRA_OPTS: '-Z1 --schema=public --blobs'

-Z1 tells pg_dump to gzip its own output at compression level 1. Those options are passed straight through to the pg_dump command at backup.go:160, and backup.go:177 then wraps that output in a second gzip layer:

gzipWriter := gzip.NewWriter(f)
...
cmd.Stdout = gzipWriter

So the resulting .sql.gz is gzipped twice, and needs two decompression passes to read.

Impact

Confined to the test setup — the shipped config.yaml.example correctly uses --schema=public -b with no -Z. But it means the compose file exercises a materially different (and broken) path from the documented configuration, so it would not catch a regression in the real one. Anyone copying the compose file as a starting point inherits the problem.

Related: commit 0cf8b40 fixed GZip output formatting, so this is an area that has already caused confusion once.

Suggested fix

Drop -Z1 from POSTGRES_EXTRA_OPTS in test/compose.yaml, leaving compression to the application.

Optionally, reject a -Z/--compress flag in postgres_extra_opts at startup with a clear error, since it is never correct given the application always gzips.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready-for-agentFully specified, ready for an AFK agent to pick up

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions