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

It'd be really nice to support blob sync #119

Open
shayonj opened this issue Apr 26, 2024 · 0 comments
Open

It'd be really nice to support blob sync #119

shayonj opened this issue Apr 26, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@shayonj
Copy link
Owner

shayonj commented Apr 26, 2024

I'd love for pg_easy_replicate to support blob sync. I feel like that'd really bring it home when it comes to supporting a full replication. While its hard to do that while replication is ongoing - I am wonder we can do something where the blobs are synced over post switchover.

The benefit of post switchover is that the source database would be in ready only mode. The trade off here is that the blobs sync would be delay, so as long as your application can tolerate the delay its fine. Not the perfect solution but at least you won't have write custom tooling to perform the sync yourself.

It could work something like this

  • pg_easy_replicate can take in an additional flag --copy-blob-post-sync
  • Makes use of lo_import and lo_export to perform an export of large objects from source DB on to file system
  • Create a temporary table to store OID mappings. Update this table for exported data.
  • Import the large object file and get the new OID and update it in the temp table.
  • Update the referencing tables as needed based on the mapping

Open questions

  • Will need to handle bytea?
  • Easy way to figure out which OIDs map to what tables
@shayonj shayonj added the enhancement New feature or request label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant