{"id":21688,"library":"pgvecto-rs","title":"pgvecto-rs Python Binding","description":"Python binding for pgvecto.rs, a vector similarity search extension for PostgreSQL. Current version 0.2.2, requires Python 3.8-3.12. Provides client and ORM integrations for vector operations in PostgreSQL.","status":"active","version":"0.2.2","language":"python","source_language":"en","source_url":"https://github.com/tensorchord/pgvecto.rs","tags":["vector-database","postgresql","embeddings","pgvector","similarity-search"],"install":[{"cmd":"pip install pgvecto-rs","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"ORM support for vector columns","package":"sqlalchemy","optional":true}],"imports":[{"wrong":"from pgvecto_rs import client","symbol":"client","correct":"import pgvecto_rs"}],"quickstart":{"code":"from pgvecto_rs import client\n\nconn = client.connect(\n    host='localhost',\n    port=5432,\n    user='postgres',\n    password=os.environ.get('PGPASSWORD', ''),\n    database='vectordb'\n)\nconn.execute(\"CREATE EXTENSION IF NOT EXISTS vectors\")\nconn.execute(\"CREATE TABLE IF NOT EXISTS items (id bigserial PRIMARY KEY, embedding vector(3))\")\nconn.execute(\"INSERT INTO items (embedding) VALUES ('[1,2,3]'::vector)\")\nresults = conn.execute(\"SELECT * FROM items ORDER BY embedding <-> '[3,2,1]'::vector LIMIT 5\")\nfor row in results:\n    print(row)","lang":"python","description":"Connect to PostgreSQL, enable pgvecto.rs extension, create a vector table, insert and query vectors."},"warnings":[{"fix":"Use client.connect(...) with parameters, not raw psycopg2 connections.","message":"The 'pgvecto_rs.client' module uses a different connection API than psycopg2. Do not use psycopg2 connection objects directly; use client.connect().","severity":"breaking","affected_versions":"all"},{"fix":"Cast vectors to string: str([1,2,3]) or use f\"'{list}'::vector\".","message":"Vector dimensions must match column definition when inserting. Use string representation like '[1,2,3]'::vector. Lists or numpy arrays are not directly accepted.","severity":"gotcha","affected_versions":"all"},{"fix":"Check the official documentation for supported features. For connection pooling, use SQLAlchemy or another pooling library.","message":"The 'client' module is not a drop-in replacement for 'psycopg2'. It wraps a different underlying driver (Rust-based). Some psycopg2 features (e.g., connection pooling, async) may not be available.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'-3.12':23 '0.2.2':19 '3.8':22 'bind':5,7 'client':25 'current':17 'databas':36 'embed':38 'extens':14 'integr':28 'oper':31 'orm':27 'pgvecto':2 'pgvecto-r':1 'pgvecto.rs':9 'pgvector':39 'postgresql':16,33,37 'provid':24 'python':4,6,21 'requir':20 'rs':3 'search':13,42 'similar':12,41 'similarity-search':40 'vector':11,30,35 'vector-databas':34 'version':18","created_at":"2026-04-27T17:01:13.212888+00:00","updated_at":"2026-04-27T17:01:13.212888+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.2.2","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/pgvecto-rs/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["vector-search","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":null}}