From 5048785087c1f6a84f9fc3351b509bc8da52f205 Mon Sep 17 00:00:00 2001 From: Jen Altavilla Date: Mon, 11 May 2026 15:01:40 -0400 Subject: [PATCH] Add missing error check of rows.Err to load types. --- derived_types.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/derived_types.go b/derived_types.go index 89b9a77c1..3916006be 100644 --- a/derived_types.go +++ b/derived_types.go @@ -236,6 +236,11 @@ func (c *Conn) LoadTypes(ctx context.Context, typeNames []string) ([]*pgtype.Typ } result = append(result, type_) } + + if err := rows.Err(); err != nil { + return nil, fmt.Errorf("While processing rows: %w", err) + } + return result, nil }