Skip to content

Commit 326e7d0

Browse files
committed
fix CopyData comment
1 parent b3b8332 commit 326e7d0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

copy.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,13 @@ func (ci *copyin) Exec(v []driver.Value) (r driver.Result, err error) {
274274
return driver.RowsAffected(0), nil
275275
}
276276

277-
// CopyData executes a raw CopyData command using the PostgreSQL Frontend/Backend
278-
// protocol. Use Exec(nil) to finish the command.
277+
// CopyData inserts a raw string into the COPY stream. The insert is
278+
// asynchronous and CopyData can return errors from previous CopyData calls to
279+
// the same COPY stmt.
280+
//
281+
// You need to call Exec(nil) to sync the COPY stream and to get any
282+
// errors from pending data, since Stmt.Close() doesn't return errors
283+
// to the user.
279284
func (ci *copyin) CopyData(ctx context.Context, line string) (r driver.Result, err error) {
280285
if ci.closed {
281286
return nil, errCopyInClosed

0 commit comments

Comments
 (0)