From e77ab91e17c5ccdc3259ca8c6863e81b2ed618b9 Mon Sep 17 00:00:00 2001 From: Jeffrey Smith Date: Thu, 2 Apr 2026 12:01:56 +0000 Subject: [PATCH] Fix Postgres uuid/text type mismatch in connection queries ListAccessible, Resolve, and ResolveAll queries compare text user_id parameter against team_members.user_id (uuid column), causing: pq: operator does not exist: uuid = text Cast $N::uuid for the team_members subquery and team_id::text for the owner_id comparison (ext_connections.owner_id is text). Co-Authored-By: Claude Opus 4.6 (1M context) --- server/store/postgres/ext_connection.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/store/postgres/ext_connection.go b/server/store/postgres/ext_connection.go index ec2b528..878ba17 100644 --- a/server/store/postgres/ext_connection.go +++ b/server/store/postgres/ext_connection.go @@ -82,7 +82,7 @@ func (s *ConnectionStore) Resolve(ctx context.Context, userID, connType, name st AND ( (scope = 'personal' AND owner_id = $2) OR (scope = 'team' AND owner_id IN ( - SELECT team_id FROM team_members WHERE user_id = $2 + SELECT team_id::text FROM team_members WHERE user_id = $2::uuid )) OR (scope = 'global') )`, connCols) @@ -105,7 +105,7 @@ func (s *ConnectionStore) ResolveAll(ctx context.Context, userID, connType strin AND ( (scope = 'personal' AND owner_id = $2) OR (scope = 'team' AND owner_id IN ( - SELECT team_id FROM team_members WHERE user_id = $2 + SELECT team_id::text FROM team_members WHERE user_id = $2::uuid )) OR (scope = 'global') ) @@ -125,7 +125,7 @@ func (s *ConnectionStore) ListAccessible(ctx context.Context, userID string) ([] AND ( (scope = 'personal' AND owner_id = $1) OR (scope = 'team' AND owner_id IN ( - SELECT team_id FROM team_members WHERE user_id = $1 + SELECT team_id::text FROM team_members WHERE user_id = $1::uuid )) OR (scope = 'global') )