type `vector` can not be handled by the types module Postgrex.DefaultTypes
It seems when I try to save embeddings into db, it shows this error.
Here are my settings:
1.
lib/postgrex_types.ex
2. lib/masque/repo.ex
3. deps in mix.ex
4. docker-compose setup for pgvector
Is there anyone else has encoutered this problem?12 Replies
I also execute
CREATE EXTENSION IF NOT EXISTS vector;
and the result shows: Query executed OK, 0 rows affected.
. So, I think the extension is installed.
Full error message:
Did you add the config? Second step here: https://hexdocs.pm/ash_postgres/AshPostgres.Extensions.Vector.html
yes I have cnfigured that.
I am currently suspect it is my docker yaml file: previouly I define
I am testing new volume with fresh migration.
- masque_postgres_data:/var/lib/postgresql/data
when use postgres docker image, I forget to update it. So, after I use pgvector, it still use the same volume. could it be the cause?I am testing new volume with fresh migration.
🤔 I wouldn't think so TBH
That looks like a code-level issue to me
That doesn't work. It still get: same error, " (Ash.Error.Unknown) \nBread Crumbs:\n > Error returned from: Masque.Documents.Post.ash_ai_update_embeddings\n\nUnknown Error\n\n* (Postgrex.QueryError) type
vector
can not be handled by the types module Postgrex.DefaultTypes\nCan you show me your config?
sure, it is too long. how to post it across the limit...for now I will post multiple parts
Solution
just the relevant parts for now
Like where you've configured your types module in your repo
ah, this:
is not correct
This goes in your config.exs:
for relating with
config :masque, Masque.Repo
, there are 3 places:
1. dev.exs
another is runtime.exs and test. in runtime.exs, it shows:
so, I need to put that in config.exs?yes
Ok, I have added following to
config.exs
I also update the repo.ex
to remove types: Masque.PostgrexTypes
let me retry
It works now. Thanks a lot for your detailed support. It is my mistake to mis-config it to set it up repo.ex. Thanks a lot!