Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

PostgreSQL does not return the last inserted id #119

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modifying.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ log.Printf("ID = %d, affected = %d\n", lastId, rowCnt)
</pre>

Executing the statement produces a `sql.Result` that gives access to statement
metadata: the last inserted ID and the number of rows affected.
metadata: the last inserted ID (note that this is not available when using PostgreSQL) and the number of rows affected.

What if you don't care about the result? What if you just want to execute a
statement and check if there were any errors, but ignore the result? Wouldn't
Expand Down