From 3dc9d17757eb0693ffea9d73507cc316a63c969a Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Mon, 11 Jul 2022 21:15:37 -0500 Subject: [PATCH] Document new ResultReader.Values behavior --- CHANGELOG.md | 2 ++ pgconn/pgconn.go | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69c0faad..387150c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ release work due to releasing multiple packages, and less clear changelogs. `CommandTag` is now an opaque type instead of directly exposing an underlying `[]byte`. +The return value `ResultReader.Values()` is no longer safe to retain a reference to after a subsequent call to `NextRow()` or `Close()`. + `Trace()` method adds low level message tracing similar to the `PQtrace` function in `libpq`. pgconn now uses non-blocking IO. This is a significant internal restructuring, but it should not cause any visible changes on its own. However, it is important in implementing other new features. diff --git a/pgconn/pgconn.go b/pgconn/pgconn.go index e52051b3..ab2e2df9 100644 --- a/pgconn/pgconn.go +++ b/pgconn/pgconn.go @@ -1358,8 +1358,7 @@ func (rr *ResultReader) FieldDescriptions() []pgproto3.FieldDescription { } // Values returns the current row data. NextRow must have been previously been called. The returned [][]byte is only -// valid until the next NextRow call or the ResultReader is closed. However, the underlying byte data is safe to -// retain a reference to and mutate. +// valid until the next NextRow call or the ResultReader is closed. func (rr *ResultReader) Values() [][]byte { return rr.rowValues }