{"id":26863900,"url":"https://github.com/hashmap-kz/pgdump-each","last_synced_at":"2026-05-18T00:09:00.080Z","repository":{"id":284964076,"uuid":"956644595","full_name":"hashmap-kz/pgdump-each","owner":"hashmap-kz","description":"Concurrent PostgreSQL logical backup \u0026 restore tool for major version upgrades – [✩Star] if you're using it!","archived":false,"fork":false,"pushed_at":"2025-12-05T16:45:42.000Z","size":339,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-09T03:45:46.112Z","etag":null,"topics":["dba","golang","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hashmap-kz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-28T15:54:00.000Z","updated_at":"2025-12-05T16:45:46.000Z","dependencies_parsed_at":"2025-07-23T07:19:43.163Z","dependency_job_id":"40b23eeb-f353-4a33-b27d-abd14aba210c","html_url":"https://github.com/hashmap-kz/pgdump-each","commit_stats":null,"previous_names":["hashmap-kz/pgdump-each"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/hashmap-kz/pgdump-each","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashmap-kz%2Fpgdump-each","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashmap-kz%2Fpgdump-each/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashmap-kz%2Fpgdump-each/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashmap-kz%2Fpgdump-each/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashmap-kz","download_url":"https://codeload.github.com/hashmap-kz/pgdump-each/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashmap-kz%2Fpgdump-each/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33160168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"ssl_error","status_checked_at":"2026-05-17T22:39:10.741Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dba","golang","postgresql"],"created_at":"2025-03-31T03:33:08.281Z","updated_at":"2026-05-18T00:09:00.064Z","avatar_url":"https://github.com/hashmap-kz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pgdump-each\n\n`pgdump-each` is a CLI tool designed to simplify **PostgreSQL major version upgrades** by performing safe and concurrent\nlogical backups and restores of all databases in a cluster.\n\n[![License](https://img.shields.io/github/license/hashmap-kz/pgdump-each)](https://github.com/hashmap-kz/pgdump-each/blob/master/LICENSE)\n[![Go Report Card](https://goreportcard.com/badge/github.com/hashmap-kz/pgdump-each)](https://goreportcard.com/report/github.com/hashmap-kz/pgdump-each)\n[![Workflow Status](https://img.shields.io/github/actions/workflow/status/hashmap-kz/pgdump-each/ci.yml?branch=master)](https://github.com/hashmap-kz/pgdump-each/actions/workflows/ci.yml?query=branch:master)\n[![GitHub Issues](https://img.shields.io/github/issues/hashmap-kz/pgdump-each)](https://github.com/hashmap-kz/pgdump-each/issues)\n[![Go Version](https://img.shields.io/github/go-mod/go-version/hashmap-kz/pgdump-each)](https://github.com/hashmap-kz/pgdump-each/blob/master/go.mod#L3)\n[![Latest Release](https://img.shields.io/github/v/release/hashmap-kz/pgdump-each)](https://github.com/hashmap-kz/pgdump-each/releases/latest)\n\n---\n\n## 🎬 Demo: dump cluster (version 16, port 5432) and restore on cluster (version 17, port 5433).\n\n![pgdump-each demo GIF](assets/pgdump-each-usage.gif)\n\n---\n\n## ✨ Features\n\n- Concurrent `pg_dump` of every non-template database in the cluster\n- Dumps are stored in `--format=directory` with compression and parallelism\n- Dumps global objects (roles, tablespaces, etc.) via `pg_dumpall --globals-only`\n- Concurrent restore via `pg_restore`\n- Safety: Refuses to restore if the target cluster is not empty\n- KISS: It's not reinventing the wheel - just a handy wrapper around reliable PostgreSQL tools\n\n---\n\n## 🔧 Use Case\n\nDesigned for **major version upgrades** of PostgreSQL where logical backups are preferred. Typically used in the\nfollowing workflow:\n\n1. Backup all databases from an old cluster (e.g., PostgreSQL 16)\n2. Create a new clean cluster (e.g., PostgreSQL 17)\n3. Restore all databases into the new cluster\n\n---\n\n## 🧪 Backup Example\n\n```bash\npgdump-each dump \\\n  --connstr \"postgres://postgres:secret@old-cluster:5432/postgres?sslmode=disable\" \\\n  --output ./backups\n```\n\nThis will:\n\n- Create a timestamped directory in `./backups`\n- Dump every user database concurrently using `pg_dump`\n- Dump global objects using `pg_dumpall --globals-only`\n- Ensure all dump logs are captured per-database\n- Perform all jobs in a staging directory; mark status as OK only if all succeed\n- Record checksums for all files in the output directory\n\n---\n\n## ♻️ Restore Example\n\n```bash\npgdump-each restore \\\n  --connstr \"postgres://postgres:newpass@new-cluster:5432/postgres?sslmode=disable\" \\\n  --input ./backups/20250328154501.dmp\n```\n\n- Validates that the target cluster is empty (no user databases)\n- Verify all files in the input directory against `checksums.txt` before restore\n- Restores globals and all database dumps concurrently using `pg_restore`\n- Logs progress and errors per database\n\n---\n\n## ✅ Requirements\n\n- PostgreSQL client binaries in your `$PATH` (`pg_dump`, `pg_dumpall`, `pg_restore`, `psql`)\n- `PGHOST`, `PGPORT`, `PGUSER`, `PGPASSWORD` — auto-inferred from `--connstr`\n\n---\n\n## Installation\n\n### Manual Installation\n\n1. Download the latest binary for your platform from\n   the [Releases page](https://github.com/hashmap-kz/pgdump-each/releases).\n2. Place the binary in your system's `PATH` (e.g., `/usr/local/bin`).\n\n#### Example installation script for Unix-Based OS _(requirements: tar, curl, jq)_:\n\n```bash\n(\nset -euo pipefail\n\nOS=\"$(uname | tr '[:upper:]' '[:lower:]')\"\nARCH=\"$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\\(arm\\)\\(64\\)\\?.*/\\1\\2/' -e 's/aarch64$/arm64/')\"\nTAG=\"$(curl -s https://api.github.com/repos/hashmap-kz/pgdump-each/releases/latest | jq -r .tag_name)\"\n\ncurl -L \"https://github.com/hashmap-kz/pgdump-each/releases/download/${TAG}/pgdump-each_${TAG}_${OS}_${ARCH}.tar.gz\" |\ntar -xzf - -C /usr/local/bin \u0026\u0026 \\\nchmod +x /usr/local/bin/pgdump-each\n)\n```\n\n### Homebrew installation\n\n```bash\nbrew tap hashmap-kz/pgdump-each\nbrew install pgdump-each\n```\n\n---\n\n## 📂 Backup Directory Structure\n\n```\n./backups/20250328154501.dmp/\n├── globals.sql\n├── mydb1.dmp/\n│   ├── data/\n│   ├── checksums.txt\n│   └── dump.log\n├── mydb2.dmp/\n│   ├── data/\n│   ├── checksums.txt\n│   └── dump.log\n...\n```\n\n---\n\n## 📘 License\n\nMIT License. Use freely at your own risk. Contributions welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashmap-kz%2Fpgdump-each","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashmap-kz%2Fpgdump-each","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashmap-kz%2Fpgdump-each/lists"}