vimiix / django-opengauss-backend

openGauss database dialect for Django
MIT License
2 stars 0 forks source link

在执行get_or_create获取对象后,紧接着引用时,会报错Key (xxx_id)=(0) is not present in table #3

Open lesstraveller opened 1 day ago

lesstraveller commented 1 day ago

例如: user, _ = models.User.objects.get_or_create(username='san.zhang', source='local') Token.objects.get_or_create(user=user) 会报错Key (user_id)=(0) is not present in table

直接在shell中一个个命令执行不报错,感觉像是数据库写操作延迟之类的问题