{"id":37105700,"url":"https://github.com/aweris/postgres-data-dump","last_synced_at":"2026-01-14T12:44:50.765Z","repository":{"id":128927610,"uuid":"313013946","full_name":"aweris/postgres-data-dump","owner":"aweris","description":"Tool for dumping a sample of data from PostgreSQL","archived":false,"fork":false,"pushed_at":"2024-06-11T07:01:12.000Z","size":41,"stargazers_count":2,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T16:48:46.755Z","etag":null,"topics":["database","dump","manifest","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aweris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2020-11-15T11:15:17.000Z","updated_at":"2024-06-12T17:26:20.000Z","dependencies_parsed_at":"2023-04-18T09:18:05.257Z","dependency_job_id":null,"html_url":"https://github.com/aweris/postgres-data-dump","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aweris/postgres-data-dump","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aweris%2Fpostgres-data-dump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aweris%2Fpostgres-data-dump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aweris%2Fpostgres-data-dump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aweris%2Fpostgres-data-dump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aweris","download_url":"https://codeload.github.com/aweris/postgres-data-dump/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aweris%2Fpostgres-data-dump/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["database","dump","manifest","postgresql"],"created_at":"2026-01-14T12:44:50.202Z","updated_at":"2026-01-14T12:44:50.748Z","avatar_url":"https://github.com/aweris.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Postgres Data Dump\n\nThis is a simple tool for dumping a sample of data from a PostgreSQL database.\nThe resulting dump can be loaded back into the new database using standard tools\n(e.g. `psql(1)`). The original project belongs to: [dankeder/pg_dump_sample](https://github.com/dankeder/pg_dump_sample)\n\n## Why would I want this?\n\nIt is useful if you have a huge PostgreSQL database, and you need a\ndatabase with a small dataset for testing or development.\n\n## Usage\n\n### CLI\n\n```\nUsage of pdd:\n      --log-format string        log format to use. ('fmt', 'json') (default \"fmt\")\n      --log-level string         log filtering level. ('error', 'warn', 'info', 'debug') (default \"error\")\n  -v, --verbose                  verbose output\n      --addr string              TCP host:port or Unix socket depending on Network (default \"localhost:5432\")\n      --database string          Database name (default \"postgres\")\n      --user string              Database user (default \"postgres\")\n      --pass string              Database password (default \"postgres\")\n      --dial-timeout duration    Dial timeout for establishing new connections (default 5s)\n      --read-timeout duration    Timeout for socket reads. If reached, commands will fail (default 30s)\n      --max-retry int            Maximum number of retries before giving up.\n      --manifest-file string     Path to manifest file (default \".pdd.yaml\")\n      --backend string           storage backend to use (filesystem) (default \"filesystem\")\n      --filesystem-root string   local filesystem root directory (default \"/tmp/pdd\")\n      --version                  Prints version info\n```\n\n\n### Environment Variables\n\nEnvironment variables sets property value if it's not set from arguments. CLI arguments has higher priority.\n\n| Name | Property |\n|:---|:---|\n| PDD_LOG_LEVEL | `--log-format` |\n| PDD_LOG_FORMAT | `--log-level` |\n| PDD_ADDR | `--addr` |\n| PDD_DATABASE | `--database` |\n| PDD_USER | `--user` |\n| PDD_PASS | `--pass` |\n| PDD_DIAL_TIMEOUT | `--dial-timeout` |\n| PDD_READ_TIMEOUT | `--read-timeout` |\n| PDD_MAX_RETRY | `--max-retry` |\n| PDD_MANIFEST_FILE | `--manifest-file` |\n| PDD_BACKEND | `--backend` |\n| PDD_FILESYSTEM_ROOT | `--filesystem-root` |\n\n### Manifest file\n\nThe main difference between `pg_dump_sample` and `pg_dump(1)` is that\n`pg_dump_sample` requires a manifest file describing how to dump the database.\nThe manifest file is a YAML file describing what tables to dump and how to dump\nthem.\n\nA quick example:\n\n    ---\n    vars:\n      # Condition to dump only certain users\n      matching_user_id: \"(users.id BETWEEN 1000 AND 2000)\"\n\n    tables:\n      # Dump everything from table \"consts\"\n      - table: consts\n\n      # Dump only matching users\n      - table: users\n        query: \"SELECT * FROM users WHERE {{.matching_user_id}}\"\n        post_actions:\n          - \"SELECT pg_catalog.setval('users_id_seq', MAX(id) + 1, true) FROM users\"\n\n      # Dump only tickets that were bought by matching users\n      - table: tickets\n        query: \u003e\n          SELECT purchases.* FROM purchases, users\n          WHERE\n            purchases.buyer_id = users.id\n            AND {{.matching_user_id}}\n\n\nCurrently, these top-level keys are available:\n\n#### `vars`\n\nDefinitions of variables which will be used to replace placeholders in queries.\n\n#### `tables`\n\nList of tables to dump. Tables are dumped in the order they are specified in the\nmanifest file, with one exception: if the table contains foreign keys\nreferencing another table, the referenced table will be dumped first. This is to\nensure that the dump can be loaded later without errors.\n\nBy default, all rows of the table will be dumped. If you don't want to dump all\nthe rows use the `query` to specify a SELECT SQL statement which returns the\nrows you want to dump.\n\n## Development \n\n```\nUsage:\n  make \u003ctarget\u003e\n\nTargets:\n  help                    shows this help message\n  fix                     Fix found issues (if it's supported by the $(GOLANGCI_LINT))\n  fmt                     Runs gofmt\n  lint                    Runs golangci-lint analysis\n  clean                   Cleanup everything\n  vendor                  Updates vendored copy of dependencies\n  build                   Builds binary\n  version                 Shows application version\n  test                    Runs go test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faweris%2Fpostgres-data-dump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faweris%2Fpostgres-data-dump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faweris%2Fpostgres-data-dump/lists"}