Custom vector type with pgvector
I'm trying to use the
pgvector
extension with a custom type but am running into an issue with the migration file. My custom type looks like
However when adding a vector column my generated migration file looks like
Notice the quotes around "vector(3)"
. Postgres is interpreting this as the literal type "vector(3)" instead of vector from pgvector. Applying the migration gives me a the following error:PostgresError: type "vector(3)" does not exist
I confirmed that removing the quotes fixes the issue. Is there a way to tell the custom type to not wrap quotes here?4 Replies
@fjorn did you ever find a solution for this?
Sort of. It actually does work for a migration that declares the table instead of altering it by adding a column. The work around works for me since my project is early enough to restart my migrations to include vectors on the original table definition. This may have to be submitted as an actual bug github issue on the drizzle-kit mirror though if it's still happening for table altering migrations
oh I see, so basically if it's a new table, you're good, otherwise you'll have to manually edit the SQL file to remove the quotes
that's been my experience yes