From 2498d7dee7f78f1d6d19723f5c4c42bed2e33b9b Mon Sep 17 00:00:00 2001 From: Colin C Date: Fri, 6 Jan 2023 16:15:45 -0500 Subject: [PATCH] PostgreSQL does not return the last inserted id LastInsertId() will not work as intended --- modifying.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modifying.md b/modifying.md index 487aac3..934ef7c 100644 --- a/modifying.md +++ b/modifying.md @@ -36,7 +36,7 @@ log.Printf("ID = %d, affected = %d\n", lastId, rowCnt) 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