laravel/telescope

Error with ::vector(1536) – pgvector + PostgreSQL

Open

#1,612 opened on Jul 20, 2025

View on GitHub
 (2 comments) (0 reactions) (0 assignees)PHP (5,187 stars) (654 forks)user submission
help wanted

Description

Telescope Version

5.10.0

Laravel Version

12.20.0

PHP Version

8.4.10

Database Driver & Version

pgsql 17

Description

I’m running into a parsing error when using a query like this in Telescope:

Parse error: Unexpected "::vector(1"
This likely happens because you're using the default "sql" dialect.

This is the line that seems to break it:

?::vector(1536)

It’s valid PostgreSQL syntax when using the pgvector extension, works fine in the database itself. But whatever is parsing the query (probably for display or formatting in the frontend) doesn’t seem to recognize the ::vector cast and throws an error.

My Query (Truncated):

WITH vectorchord_candidates AS (
    SELECT id, chunk, embedding, agent_file_id,
           {$distanceOperator}
    FROM documents
    WHERE agent_id = ?
    ORDER BY embedding <-> ?::vector(1536)
    LIMIT ?
)

Steps To Reproduce

Steps to Reproduce

  1. Use PostgreSQL with the pgvector extension installed.
  2. Run a query that uses ?::vector. Example:
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\DB;

Route::get('/test', function () {
    DB::select('
        SELECT ARRAY[0.0, 0.1, 0.2, 0.3, 0.4, 0.0]::vector(6) AS test_vector
    ');
});
  1. Open the query in Telescope.

Contributor guide

Error with ::vector(1536) – pgvector + PostgreSQL · laravel/telescope#1612 | Good First Issue