{"id":24782580,"url":"https://github.com/levkk/pg-rds-params-sync","last_synced_at":"2025-06-18T20:38:01.824Z","repository":{"id":50168460,"uuid":"237082025","full_name":"levkk/pg-rds-params-sync","owner":"levkk","description":"Compare PostgreSQL settings between two databases to detect drift.","archived":false,"fork":false,"pushed_at":"2023-10-18T01:50:27.000Z","size":53,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T10:14:26.438Z","etag":null,"topics":["postgresql","rds"],"latest_commit_sha":null,"homepage":"","language":"Python","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/levkk.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}},"created_at":"2020-01-29T21:04:17.000Z","updated_at":"2022-03-13T14:04:28.000Z","dependencies_parsed_at":"2022-08-03T21:15:11.969Z","dependency_job_id":null,"html_url":"https://github.com/levkk/pg-rds-params-sync","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levkk%2Fpg-rds-params-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levkk%2Fpg-rds-params-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levkk%2Fpg-rds-params-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levkk%2Fpg-rds-params-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/levkk","download_url":"https://codeload.github.com/levkk/pg-rds-params-sync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236169067,"owners_count":19106105,"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","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":["postgresql","rds"],"created_at":"2025-01-29T11:18:06.737Z","updated_at":"2025-01-29T11:18:07.400Z","avatar_url":"https://github.com/levkk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostgreSQL RDS Parameters Sync\nCompare PostgreSQL settings between two databases to detect drift.\n\n## Features\n\n### Audit particular settings\nExample:\n```bash\n$ pgrdsparamsync audit --parameters=max_wal_size\n```\n\nIt will get all the databases in the account and region and display their `max_wal_size` value. \nSince this can be an expensive operation, a local 1 hour cache is used for each parameter group.\n\nIf only a subset of databases is of interest, `--db-name-like` can be used to filter based on the database name.\n\nExample:\n```bash\n$ pgrdsparamsync audit --parameters=max_wal_size,min_wal_size --db-name-like=production\n```\n\nIt will audit only the databases that contain the string \"production\" in their name and display `max_wal_size` and `min_wal_size`.\n\nFor reporting, we can also print out the above table in CSV format.\n\nExample:\n```bash\n$ pgrdsparamsync audit --parameters=max_wal_size,min_wal_size --fmt=csv\n```\n\n\n### Compare a database to another or a parameter group\nExample:\n```bash\n$ pgrdsparamsync rds-compare --target-db=\"users-production\" --other-db=\"orders-production\"\n```\n\nIt will print all the settings that differ between the two databases.\n\nIf the goal is to set a standard against the entire database fleet, it is possible to compare a database to a parameter group that represents that standard.\n\nExample:\n```bash\n$ pgrdsparamsync rds-compare --target-db=\"users-production\" --parameter-group=\"pg-11-standard\"\n```\n\nIt will print all the settings that differ between the target database and the parameter group.\n\n\n### Compare two databases directly\nExample:\n```bash\n$ pgrdsparamsync pg-compare \\\n--target-db-url=\"postgres://user:password@users-production.rds.awsamazon.com\" \\\n--other-db-url=\"postgres://user:password@orders-production.rds.awsamazom.com\"\n```\n\nRDS parameter groups use formulas to calculate certain settings (e.g. `shared_buffers`, `effective_cache_size`, etc.) by default. Sometimes, it is useful to know the actual value. This will connect to the databases directly, query `pg_settings`, and print the settings that differ.\n\n\n### Caching\nFetching parameter groups for 100s of databases is long and expensive. We added a local cache with a 1h TTL. It's stored in `/tmp/pgrdsparamsync`. The first run of the application will be slow, but subsequent runs will be much faster. To increase the TTL or bust the cache, add an environment variable `CACHE_TTL` with a value that's not 1h, for example `$ export CACHE_TTL=7200` which will set the TTL to 2 hours (7200 seconds).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevkk%2Fpg-rds-params-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flevkk%2Fpg-rds-params-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevkk%2Fpg-rds-params-sync/lists"}