Skip to content

pgvector: Include the actual SQL exception when reporting the error. #1684

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

superkelvint
Copy link

@superkelvint superkelvint commented May 1, 2025

The pgvector document store does not currently report SQL exceptions, which makes debugging difficult.

Using hayhooks, for example, with this patch, the error goes from this:

│ Server error: Pipeline execution failed: The following component failed to run: │
│ Component name: 'indexing:writer'                                               │
│ Component type: 'DocumentWriter'                                                │
│ Error: Could not write documents to PgvectorDocumentStore.                      │
│ You can find the SQL query and the parameters in the debug logs.                │

to this:

│ Server error: Pipeline execution failed: The following component failed to run:
│ Component name: 'indexing:writer'
│ Component type: 'DocumentWriter'
│ Error: Could not write documents to PgvectorDocumentStore:         │
│ expected 768 dimensions, not 384 
│You can find the SQL query and the parameters in the debug logs."}                   │

Proposed Changes:

Include the SQL exception in the reporting message.

Checklist

@superkelvint superkelvint requested a review from a team as a code owner May 1, 2025 15:51
@superkelvint superkelvint requested review from vblagoje and removed request for a team May 1, 2025 15:51
@anakin87 anakin87 self-requested a review May 2, 2025 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant