Skip to content

Show pgvector columns as vectors, not long text #3599

Closed

Description

@datlechin

Problem

A pgvector column (vector, halfvec, sparsevec) is treated as plain text:

  • The PostgreSQL driver decodes only bytea and boolean specially and returns the rest as text (apple/Plugins/PostgreSQLDriverPlugin/LibPQCellDecoding.swift:14). A vector(1536) cell holds the server's text form, [0.0123,-0.0456,...], 1,536 numbers on one line.
  • ColumnTypeClassifier has no entry for these types and falls back to text (apple/TablePro/Core/Services/ColumnTypeClassifier.swift:146). The cell opens in the plain text editor, with no dimension count and no check on the value before Save.
  • Every browsed row carries each vector in full, roughly 15 KB of text per 1,536-dimension value, so 1,000 rows pull about 15 MB before any cell is opened.

Two pieces already exist. The Structure tab shows an HNSW index type from pgvector (features/table-structure.mdx, Indexes). PostGIS set the pattern for an extension type: a connect-time probe finds its type oids (apple/Plugins/PostgreSQLDriverPlugin/PostgreSQLPluginDriver.swift:82), and its values render as EWKT (#1458, databases/postgresql.mdx).

Proposed solution

  • Find pgvector's type oids on connect, the way the PostGIS probe does, so a vector(n) column is known as a vector of n dimensions.
  • In the grid, a short summary instead of the full literal: the first few elements and the dimension count, such as [0.0123, -0.0456, 0.0789, …] 1536 dims.
  • A vector viewer when the cell opens: one element per row with its index, Copy as JSON array, and Edit as Text for the raw literal, as the array editor has (databases/postgresql.mdx, array editors).
  • A dimension check before Save, so a value of the wrong length is flagged on the row instead of failing at the server.
  • vector(n), halfvec(n) and sparsevec(n) in the Structure tab's type picker when the extension is installed.

Oracle VECTOR, Cassandra vector<float, n> and the Weaviate plugin's vector column could share the same display later; this issue covers PostgreSQL. Not fetching large values until a cell is opened is #2490, and this issue does not depend on it.

Done means: a table with a vector(1536) column browses with readable cells, the viewer shows every element, and a wrong-length edit is caught before Save.

Alternatives considered

Casting in SQL: SELECT id, vector_dims(embedding), subvector(embedding, 1, 5) FROM items, or embedding::real[] to reach the array editor. Neither helps when browsing a table.

Platform

macOS

Related database type

PostgreSQL

Activity

  1. added
    enhancement
    platform-macos
    on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementplatform-macos

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions