build-web-application-with-golang
build-web-application-with-golang copied to clipboard
5.4节中postgreSql获取自增id的另一种方式
5.4节中postgreSql获取自增id的另一种方式:
var lastInsertId int err = db.QueryRow("select last_value from userinfo_uid_seq").Scan(&lastInsertId) checkErr(err)
pgSQL是以sequence的方式支持自增的。