Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 13, 2025

  • Add postgresExportLargeObject function for exporting large objects to files
  • Implement C++ backend using libpq's lo_export() function
  • Add comprehensive parameter validation and error handling
  • Create R wrapper function with transaction safety checks
  • Add comprehensive test coverage for various scenarios
  • Address review feedback: remove filepath default parameter and NULL checks
  • Change C++ return type to void, R function returns invisible()
  • Update documentation with transaction requirements and lo_export() formatting
  • Update tests to use file.path() instead of string concatenation
  • Fix compilation error: correct connection_export_lo_to_file return type to void

Implementation complete. The function now properly exports PostgreSQL large objects to files using streaming I/O without memory buffering, addressing the issue with large file exports failing due to memory allocation errors.

Closes #519.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link
Contributor Author

Copilot AI commented Sep 13, 2025

@krlmlr 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot AI and others added 2 commits September 13, 2025 18:35
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Export Large Objects from Postgres Add postgresExportLargeObject function for exporting large objects to files Sep 13, 2025
@Copilot Copilot AI requested a review from krlmlr September 13, 2025 18:39
Copilot finished work on behalf of krlmlr September 13, 2025 18:39
Copy link
Member

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

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

@copilot: Please heed remarks and reviewdog suggestions.

…to void, update docs and tests Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 13, 2025

@copilot: Please heed remarks and reviewdog suggestions.

All review comments and suggestions have been addressed:

  • Removed filepath default parameter and NULL checks
  • Changed C++ return type to void, R function returns invisible()
  • Updated documentation with transaction requirements and lo_export() formatting
  • Updated tests to use file.path() instead of string concatenation
  • Removed unnecessary NULL filepath test

Changes committed in e055d8c.

@Copilot Copilot AI requested a review from krlmlr September 13, 2025 18:57
Copilot finished work on behalf of krlmlr September 13, 2025 18:57
@krlmlr
Copy link
Member

krlmlr commented Sep 13, 2025

@copilot: connection.cpp:101:32: error: void value not ignored as it ought to be

…e to void Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 13, 2025

@copilot: connection.cpp:101:32: error: void value not ignored as it ought to be

Fixed the compilation error by correcting the return type of connection_export_lo_to_file from int to void and updating both the function implementation and cpp11 bindings accordingly. (b2a1234)

Copilot finished work on behalf of krlmlr September 13, 2025 19:21
@krlmlr krlmlr changed the title Add postgresExportLargeObject function for exporting large objects to files feat: New postgresExportLargeObject() function for exporting large objects to files Sep 22, 2025
@krlmlr krlmlr marked this pull request as ready for review September 22, 2025 05:33
@krlmlr krlmlr merged commit 6ca3860 into main Sep 22, 2025
5 checks passed
@krlmlr krlmlr deleted the copilot/fix-519 branch September 22, 2025 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants