{"id":14069242,"url":"https://github.com/holistics/pgcp","last_synced_at":"2025-07-30T05:31:49.498Z","repository":{"id":2891466,"uuid":"45167675","full_name":"holistics/pgcp","owner":"holistics","description":"Copying tables between Postgres databases (for analytics purpose)","archived":true,"fork":false,"pushed_at":"2023-03-16T16:37:24.000Z","size":28,"stargazers_count":7,"open_issues_count":5,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-04T10:39:25.021Z","etag":null,"topics":["data-engineering","tools"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/holistics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-10-29T07:38:03.000Z","updated_at":"2023-09-07T04:58:21.000Z","dependencies_parsed_at":"2023-07-05T19:02:49.964Z","dependency_job_id":null,"html_url":"https://github.com/holistics/pgcp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/holistics/pgcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holistics%2Fpgcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holistics%2Fpgcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holistics%2Fpgcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holistics%2Fpgcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holistics","download_url":"https://codeload.github.com/holistics/pgcp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holistics%2Fpgcp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267815187,"owners_count":24148356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["data-engineering","tools"],"created_at":"2024-08-13T07:06:44.653Z","updated_at":"2025-07-30T05:31:49.206Z","avatar_url":"https://github.com/holistics.png","language":"Ruby","readme":"# pgcp - Copy PostgreSQL tables between databases (for analytics purpose)\n\npgcp is a simple tool to copy tables from a source postgres DB to a destination postgres DB.\n\n\nThe main use case of the tool is to make a dump of data from production databases\n to a centralized database for analytics purpose. Don't expect the copy to be an exact copy,\n we do drop a lot of table's metadata and only retain what we think is important for analytics.\n\n\nWhat we retain:\n\n* Table's schema structure\n* Table's indexes\n* Table's data\n\nWhat we don't clone over (non-exhaustive):\n\n* Sequences (auto increment)\n* Triggers\n* ...\n\nRequirements:\n\n* Make sure you have `psql` installed on the machine running `pgcp`\n\n## Installation\n\n\nInstall gem from RubyGems\n\n    gem install pgcp\n\n\nCreate file `~/.pgcp.yml` that contains the credentials of your interested databases:\n\n    databases:\n      production_db:\n        user: postgres\n        password:\n        dbname: \n        host: your_production.server.com\n      analytics_db:\n        user: postgres\n        dbname: analytics\n        password:\n        host: your_analytics.server.com\n\n\n## Usage\n\nFor usage details, runs: `pgcp help`\n\nCopy a single `bookings` table from production to analytics:\n\n    pgcp -s production_db -d analytics_db -t public.bookings \n\nCopy multiple tables:\n\n    pgcp -s production_db -d analytics_db -t public.bookings public.registrations\n\n\nCopy all tables in schema public to destination database\n\n    pgcp -s production_db -d analytics_db -t public.*\n\nCopy all tables in schema public to destination database, but to a different schema\n\n    pgcp -s production_db -d analytics_db -t public.* --force-schema\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholistics%2Fpgcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholistics%2Fpgcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholistics%2Fpgcp/lists"}