【发布时间】:2021-09-21 12:14:39
【问题描述】:
有一个 Django 应用程序设置来与 YugabyteDB 通信,但是在运行迁移时我们遇到了以下错误:
Traceback (most recent call last):
File "/opt/env/lib/python3.6/site-packages/django/contrib/contenttypes/models.py", line 54, in get_for_model
ct = self.get(app_label=opts.app_label, model=opts.model_name)
File "/opt/env/lib/python3.6/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/opt/env/lib/python3.6/site-packages/django/db/models/query.py", line 380, in get
self.model._meta.object_name
__fake__.DoesNotExist: ContentType matching query does not exist.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/env/lib/python3.6/site-packages/django/db/models/query.py", line 464, in get_or_create
return self.get(**lookup), False
File "/opt/env/lib/python3.6/site-packages/django/db/models/query.py", line 380, in get
self.model._meta.object_name
__fake__.DoesNotExist: ContentType matching query does not exist.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/env/lib/python3.6/site-packages/django/db/backends/utils.py", line 62, in execute
return self.cursor.execute(sql)
File "/opt/env/lib/python3.6/site-packages/django_prometheus/db/common.py", line 63, in execute
return super(CursorWrapper, self).execute(*args, **kwargs)
psycopg2.errors.FeatureNotSupported: SAVEPOINT <transaction> not supported yet
LINE 1: SAVEPOINT "s140500455238528_x1"
^
HINT: See https://github.com/YugaByte/yugabyte-db/issues/1125. Click '+' on the description to raise its priority
由于 YugabyteDB 今天似乎不支持 SAVEPOINTS,我们如何解决这个 Django 错误?
[免责声明:这个问题最初是由 YugabyteDB 用户通过电子邮件提出的]
【问题讨论】:
标签: django yugabyte-db