© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4mo ago•
4 replies
Zane

ERROR: 42704: type "extensions.vector" does not exist

ERROR: 42704: type "extensions.vector" does not exist
LINE 9: embedding extensions.vector(1536) -- 1536 works for OpenAI embeddings, change if needed
====================
I got an error msg as above when I start a new project and run the following SQL code from Supabase doc (https://supabase.com/docs/guides/ai/langchain?database-method=sql)
Do you have any suggestions? THX.
=====================

-- Enable the pgvector extension to work with embedding vectors
create extension vector;

-- Create a table to store your documents
create table documents (
id bigserial primary key,
content text, -- corresponds to Document.pageContent
metadata jsonb, -- corresponds to Document.metadata
embedding extensions.vector(1536) -- 1536 works for OpenAI embeddings, change if needed
);

-- Create a function to search for documents
create function match_documents (
query_embedding extensions.vector(1536),
match_count int default null,
filter jsonb DEFAULT '{}'
) returns table (
id bigint,
content text,
metadata jsonb,
similarity float
)
language plpgsql
as $$
#variable_conflict use_column
begin
return query
select
id,
content,
metadata,
1 - (documents.embedding <=> query_embedding) as similarity
from documents
where metadata @> filter
order by documents.embedding <=> query_embedding
limit match_count;
end;
$$;
LangChain | Supabase Docs
Learn how to integrate Supabase with LangChain, a popular framework for composing AI, Vectors, and embeddings
LangChain | Supabase Docs
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Type "vector" does not exist
SupabaseSSupabase / help-and-questions
6mo ago
type "geometry" does not exist
SupabaseSSupabase / help-and-questions
13mo ago
type geography does not exist -- suddenly
SupabaseSSupabase / help-and-questions
4y ago
Error When Migrating Database schema extensions does not exist when migrating database
SupabaseSSupabase / help-and-questions
4y ago