A ParadeDB syntax error occurs when PostgreSQL cannot parse a query that calls ParadeDB’s vector-search functions or indexes, usually due to misplaced keywords, commas, or data-type mismatches.
PostgreSQL raises the error when it encounters invalid SQL while calling ParadeDB objects—for example, missing parentheses in CREATE INDEX ... USING hnsw
, quoting JSON incorrectly inside parade.embed()
, or mixing incompatible data types.
Read the error’s LINE
and POSITION
pointers first. Then run EXPLAIN
on the failing statement or comment-out clauses until the error disappears.This isolates the fragment ParadeDB cannot parse.
Use CREATE INDEX idx_products_vec ON Products USING hnsw(embedding) WITH (m = 16, efConstruction = 200);
The index method hnsw
must follow USING
, and WITH
options need parentheses and commas.
parade.embed()
in SELECT?Wrap the string or JSON document in single quotes and cast to jsonb
if needed: SELECT parade.embed('Mega-Widget Deluxe') AS query_vec;
Passing unquoted text raises a syntax error.
Yes.First compute similarity with <->
then filter: SELECT id, name FROM Products ORDER BY embedding <-> parade.embed('Deluxe drill') LIMIT 10;
Ensure ORDER BY precedes LIMIT; otherwise PostgreSQL misreads the clause sequence.
INSERT
fail?Embedding columns require the vector
type.Use parameter placeholders or explicit casts: INSERT INTO Products (name, price, stock, embedding) VALUES ($1, $2, $3, $4::vector);
• Enable psql --echo-all
in development.• Keep functions and parameters on new lines.• Always cast JSON to jsonb
.• Use pg_format
to auto-format SQL before running.
See the “Example Query” section below.
.
No. Drop and recreate the index with new M
or efConstruction
values.
Yes. Use SELECT parade.embed_batch(array['text1','text2'])
to get an array of vectors.
ParadeDB requires PostgreSQL 15 or later for optimal vector performance.