Fix account_risk_state missing on PostgreSQL: probe table before cache skip.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-01 08:29:46 +08:00
parent d7ea7b9e8a
commit cd636ff1c3
4 changed files with 87 additions and 46 deletions
+8
View File
@@ -120,6 +120,14 @@ def is_schema_migration_error(exc: BaseException) -> bool:
return False
def is_missing_relation_error(exc: BaseException) -> bool:
"""表/视图不存在。"""
if is_schema_migration_error(exc):
msg = str(exc).lower()
return any(x in msg for x in ("no such table", "does not exist", "undefined table"))
return False
def rollback_if_postgres(conn: "DbConnection") -> None:
if is_postgres():
try: