https://github.com/getyourguide/pgoutputdump
A simple CLI to read pgoutput format from a replication slot
https://github.com/getyourguide/pgoutputdump
Last synced: over 1 year ago
JSON representation
A simple CLI to read pgoutput format from a replication slot
- Host: GitHub
- URL: https://github.com/getyourguide/pgoutputdump
- Owner: getyourguide
- License: apache-2.0
- Created: 2021-12-10T13:38:53.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-31T07:01:00.000Z (about 2 years ago)
- Last Synced: 2025-01-14T14:26:32.591Z (over 1 year ago)
- Language: Java
- Size: 35.2 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# PgOutputDump
A simple CLI to read pgoutput format from a replication slot and optionally dump
it to a file. This file can later be read back using the same CLI.
# Usage
## Read replication stream from live database
Note: Java >= 11 is required.
```bash
java -jar target/PgOutputDump-jar-with-dependencies.jar \
--host=localhost \
--database=my_databsase \
--user=master \
--password=my_password \
--slot=my_slot \
--publication=a_replication \
-c 10
```
To dump a copy of the binary stream, use the `--file output.bin` option. The file is simply written
as the payload size (int32) followed by the payload itself for each received replication event.
```bash
## Read replication stream from a local file
```bash
java -jar target/PgOutputDump-jar-with-dependencies.jar \
--file output.bin
```
Note: This tool will not create nor the slot nor the replication, they need to exist
beforehand.