Skip to content

refactor: extract PostgresBinaryParser base class from PostgresBinaryReader#411

Merged
staticlibs merged 4 commits intoduckdb:mainfrom
arnoldwakim:refactor/extract-postgres-binary-parser
Mar 31, 2026
Merged

refactor: extract PostgresBinaryParser base class from PostgresBinaryReader#411
staticlibs merged 4 commits intoduckdb:mainfrom
arnoldwakim:refactor/extract-postgres-binary-parser

Conversation

@arnoldwakim
Copy link
Copy Markdown
Contributor

@arnoldwakim arnoldwakim commented Mar 12, 2026

First step of addressing #405 to support decoding from a file.
In a follow up PR we shall introduce a new class to be able to read from files (bin dumps).

This PR extracts all binary data parsing logic into a standalone PostgresBinaryParser class. PostgresBinaryReader holds it as a member (composition) and feeds it buffers from PQgetCopyData.
This should enables future readers (file-based) to reuse the same parsing code.

Copy link
Copy Markdown
Collaborator

@staticlibs staticlibs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the PR and sorry for the delayed review! I think it is a good idea to factor-out the binary parser. Just can we do this without introducing multiple inheritance for PostgresBinaryReader - using some kind of composition instead? I understand that it will require more changes - still should be easier to debug.

@arnoldwakim
Copy link
Copy Markdown
Contributor Author

No worries, thank you for the review @staticlibs !
For some reason some tests keep failing on my mac.
I just want to make sure the CI/tests pass first.

@staticlibs staticlibs merged commit 5c692c2 into duckdb:main Mar 31, 2026
15 checks passed
@staticlibs
Copy link
Copy Markdown
Collaborator

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants