Postgres Node fails with "split is not a function" when using pgvector parameter

doctorquesero
HOBBYOP

a month ago

Hello, I am having a persistent issue with the Postgres node when trying to perform a semantic search with pgvector. The node fails with a TypeError: properties.string.split is not a function. My Goal: I want to run a SELECT query to find the cosine similarity between a stored vector and a new vector passed as a parameter. My Setup: * n8n Version: 1.113.3 (Self-hosted on Railway) * Database: PostgreSQL with pgvector extension * Embedding Model: OpenAI text-embedding-3-small (1536 dimensions) Node Configuration: * Node:Postgres * Query: ```sql SELECT summary, 1 - (embedding_vector <=> $1::vector) AS similarity FROM learned_facts ORDER BY similarity DESC LIMIT 1; ``` * Query Parameters (Expression): ``` {{ [ $items("N2.2-Generar Embedding")[0].json.data[0].embedding ] }} ``` The Problem: The execution fails on this Postgres node with the TypeError: properties.string.split is not a function. This happens on a clean, updated n8n instance. We have confirmed the database schema is correct embedding_vector VECTOR(1536)), the extension is active, and the input data is a valid array of numbers. It seems the Postgres node has a bug and cannot handle an array of numbers as a parameter for a vector type. Is there a known workaround for this bug, or is this a confirmed issue? Thank you.

$10 Bounty

1 Replies

Railway
BOT

a month ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


Loading...
Postgres Node fails with "split is not a function" when using pgvector parameter - Railway Help Station