Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Replication Protocol Version 2 #2

Open
5 tasks
3n0ugh opened this issue Jul 4, 2024 · 0 comments
Open
5 tasks

Support for Replication Protocol Version 2 #2

3n0ugh opened this issue Jul 4, 2024 · 0 comments
Assignees

Comments

@3n0ugh
Copy link
Member

3n0ugh commented Jul 4, 2024

Feature Request: Support for Replication Protocol Version 2

Is your feature request related to a problem? Please describe.

Currently, the go-pq-cdc library supports only replication protocol version 3. This limits its use to PostgreSQL server versions 15 and above. Introducing support for replication protocol version 2 would enable go-pq-cdc to function with PostgreSQL server version 14 as well, thus expanding its compatibility.

Describe the solution you'd like

Implement conditional handling for replication protocols based on the PostgreSQL server version:

  1. After establishing a connection, determine the PostgreSQL server version.
    • If the server version is 15 or higher, continue using replication protocol version 3.
    • If the server version is between 14 and 15 (inclusive of 14), switch to using replication protocol version 2.
    • For any server version below 14, return an error indicating that the PostgreSQL version is unsupported.

By adding this logic, go-pq-cdc can support a wider range of PostgreSQL versions while ensuring appropriate protocol compatibility.

Sources

Protocol Versions: https://www.postgresql.org/docs/current/protocol-logical-replication.html#:~:text=Version%202%20is%20supported%20only,streaming%20of%20two%2Dphase%20commits.

go-pq-cdc protocol choose:

"proto_version '3'",

Tasks

@omersisman omersisman self-assigned this Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants