{"id":14029925,"url":"https://github.com/jackc/pglogrepl","last_synced_at":"2025-05-14T10:13:06.947Z","repository":{"id":39844536,"uuid":"203259544","full_name":"jackc/pglogrepl","owner":"jackc","description":"PostgreSQL logical replication library for Go.","archived":false,"fork":false,"pushed_at":"2025-03-31T21:55:43.000Z","size":57,"stargazers_count":361,"open_issues_count":14,"forks_count":67,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-03T23:02:57.094Z","etag":null,"topics":["go","golang","postgresql","replication"],"latest_commit_sha":null,"homepage":null,"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/jackc.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":"2019-08-19T22:33:46.000Z","updated_at":"2025-04-02T15:16:47.000Z","dependencies_parsed_at":"2024-06-18T12:40:13.695Z","dependency_job_id":"50df387a-d178-47ca-b100-d0fef93c94d5","html_url":"https://github.com/jackc/pglogrepl","commit_stats":{"total_commits":71,"total_committers":20,"mean_commits":3.55,"dds":0.676056338028169,"last_synced_commit":"828fbfe908e97cfeb409a17e4ec339dede1f1a17"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackc%2Fpglogrepl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackc%2Fpglogrepl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackc%2Fpglogrepl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackc%2Fpglogrepl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackc","download_url":"https://codeload.github.com/jackc/pglogrepl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248338407,"owners_count":21087208,"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":["go","golang","postgresql","replication"],"created_at":"2024-08-11T21:01:09.853Z","updated_at":"2025-04-11T03:38:31.291Z","avatar_url":"https://github.com/jackc.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"[![](https://godoc.org/github.com/jackc/pglogrepl?status.svg)](https://godoc.org/github.com/jackc/pglogrepl)\n[![CI](https://github.com/jackc/pglogrepl/actions/workflows/ci.yml/badge.svg)](https://github.com/jackc/pglogrepl/actions/workflows/ci.yml)\n\n# pglogrepl\n\npglogrepl is a Go package for PostgreSQL logical replication.\n\npglogrepl uses package github.com/jackc/pgx/v5/pgconn as its underlying PostgreSQL connection.\n\nProper use of this package requires understanding the underlying PostgreSQL concepts. See\nhttps://www.postgresql.org/docs/current/protocol-replication.html.\n\n## Example\n\nIn `example/pglogrepl_demo`, there is an example demo program that connects to a database and logs all messages sent over logical replication.\nIn `example/pgphysrepl_demo`, there is an example demo program that connects to a database and logs all messages sent over physical replication.\n\n## Testing\n\nTesting requires a user with replication permission, a database to replicate, access allowed in `pg_hba.conf`, and\nlogical replication enabled in `postgresql.conf`.\n\nCreate a database:\n\n```\ncreate database pglogrepl;\n```\n\nCreate a user:\n\n```\ncreate user pglogrepl with replication password 'secret';\n```\n\nIf you're using PostgreSQL 15 or newer grant access to the public schema, just for these tests:\n\n```\ngrant all on schema public to pglogrepl;\n```\n\nAdd a replication line to your pg_hba.conf:\n\n```\nhost replication pglogrepl 127.0.0.1/32 md5\n```\n\nChange the following settings in your postgresql.conf:\n\n```\nwal_level=logical\nmax_wal_senders=5\nmax_replication_slots=5\n```\n\nTo run the tests set `PGLOGREPL_TEST_CONN_STRING` environment variable with a replication connection string (URL or DSN).\n\nSince the base backup would request postgres to create a backup tar and stream it, this test cn be disabled with\n```\nPGLOGREPL_SKIP_BASE_BACKUP=true\n```\n\nExample:\n\n```\nPGLOGREPL_TEST_CONN_STRING=postgres://pglogrepl:secret@127.0.0.1/pglogrepl?replication=database go test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackc%2Fpglogrepl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackc%2Fpglogrepl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackc%2Fpglogrepl/lists"}