postgresSQL这种情况插入数据无法返回主键id #1031
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#1031
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
postgresSQL数据库,若表同时有自增主键字段和一个'bigserial'类型字段,插入数据时不会返回主键id。例如:
表结构:
插入一天数据:
sql日志如下:
日志打印显示的是
RETURNING "serial"
,但如果将Id
字段放到Serial
字段下面,就会正确返回id数据所以在有自增主键的情况下,能否优先返回主键的值。结构体字段顺序的改变不应该影响返回结果。