Skip to content

Commit 5741591

Browse files
committed
update docs
1 parent e2239b6 commit 5741591

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/questions.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,10 @@ stmt = ( # [!code word:noload]
5555
.order_by(desc(self.model.join_time))
5656
)
5757
```
58+
59+
## PostgreSQL 主键自增失败
60+
61+
当通过 sql 脚本执行插入数据后,由于 pg 特性,序列值不会与表中最大值同步,此时如果通过代码执行写入操作,可能触发
62+
`DETAIL: Key (id)=(x) already exists` 的错误
63+
64+
解决方案请自行搜索:如何重置 pg 主键序列?

0 commit comments

Comments
 (0)