mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 21:09:41 -05:00
[PR #16299] [CLOSED] fix: PGVECTOR_PGCRYPTO syntax error from failure to bind metadata variable in some sqlalchamy/postgres versions #24090
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/16299
Author: @psy42a
Created: 8/5/2025
Status: ❌ Closed
Base:
dev← Head:patch-1📝 Commits (1)
f3b0f7dFix syntax error where the previous use of :metadata::text in some sqlachamy/postgres versions doesn't bind at all📊 Changes
1 file changed (+7 additions, -4 deletions)
View changed files
📝
backend/open_webui/retrieval/vector/dbs/pgvector.py(+7 -4)📄 Description
Fix for Experimental PGVECTOR_PGCRYPTO feature - failure to bind metadata variable on insert
In testing of the experimental PGVECTOR_PGCRYPTO feature we found that it failed to process/upload any documents due to a syntax error raised from failure to bind the metadata variable in the form "pgp_sym_encrypt(:metadata::text, :key)" this proposed fix (potentially just removing ::text might also work) explicitly serialises the json as a text variable and ensures that sqlalchemy correctly treats it as text and binds it correctly. Tested in Openwebui version v0.6.18 using Postgres 17.4
3 changes were made to the insert / upsert functions:
We have then validated upload was successful for the document_chunk table with text, vmetadata fields defined as bytea fields and validated document retrieval and image summary of pdf works as expected using docling and the image summary api functionality.
Fixed
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreements (CLA) and Open WebUI specific Contributor License Agreements, and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.