Skip to content

register_vector() Fails When Only 'vector' Extension is Installed, Missing 'halfvec' and 'sparsevec #79

@vatsrahul1001

Description

@vatsrahul1001

Description:

After the 0.3.0 release, we have encountered an issue where the register_vector function throws an error if our PostgreSQL database only has the vector extension installed, and not halfvec or sparsevec.

Steps to Reproduce:

Install the pgvector extension in PostgreSQL without halfvec or sparsevec.
Call the register_vector function.
Error:

  File "/usr/local/lib/python3.9/site-packages/pgvector/psycopg2/register.py", line 23, in register_vector
    cur.execute('SELECT NULL::sparsevec')
psycopg2.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction bloc

Expected Behavior:

The function should not break if halfvec or sparsevec are not present. It should work seamlessly with only the vector extension installed.

Link to Relevant Code:

register_vector

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions