{"record":{"id":"449ee19faab66cff","repo":"MemPalace/mempalace","slug":"pgvector-query-failed-exc","errorCode":null,"errorMessage":"pgvector query failed: {exc}","messagePattern":"pgvector query failed: (.+?)","errorType":"exception","errorClass":"BackendError","httpStatus":null,"severity":"error","filePath":"mempalace/backends/pgvector.py","lineNumber":552,"sourceCode":"\n    def _execute(self, sql: str, params=None, *, fetch: bool = False, many: bool = False):\n        with self._lock:\n            conn = self._connect()\n            try:\n                with conn.cursor() as cur:\n                    if many:\n                        cur.executemany(sql, params or [])\n                        rows = None\n                    else:\n                        cur.execute(sql, params or [])\n                        rows = cur.fetchall() if fetch else None\n                conn.commit()\n            except Exception as exc:  # noqa: BLE001 - normalize to BackendError\n                try:\n                    conn.rollback()\n                except Exception:  # pragma: no cover - rollback best effort\n                    pass\n                raise BackendError(f\"pgvector query failed: {exc}\") from exc\n        return rows\n\n    def ping(self) -> None:\n        self._execute(\"SELECT 1\", fetch=True)\n\n    def ensure_extension(self) -> None:\n        try:\n            self._execute(\"CREATE EXTENSION IF NOT EXISTS vector\")\n        except BackendError:\n            # Extension may already exist or require elevated privilege; the\n            # table create will fail loudly later if the vector type is absent.\n            logger.debug(\"pgvector CREATE EXTENSION skipped\", exc_info=True)\n\n    def table_exists(self, table: str) -> bool:\n        rows = self._execute(\n            \"SELECT 1 FROM information_schema.tables \"\n            \"WHERE table_schema = current_schema() AND table_name = %s\",\n            [table],","sourceCodeStart":534,"sourceCodeEnd":570,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/backends/pgvector.py#L534-L570","documentation":"Error \"pgvector query failed: {exc}\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/backends/pgvector.py:552 when the library encounters an invalid state.","commonSituations":"A query against the pgvector table failed (missing extension, wrong dimension, or dropped table).","solutions":["Inspect the underlying psycopg error; verify the table exists, the pgvector extension is installed, and dimensions match"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}