You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "zverok (via GitHub)" <gi...@apache.org> on 2026/03/25 14:03:28 UTC
Re: [I] Attempt to delete user via /api/v1/security/users/{pk} fails for "update or delete on table "ab_user" violates foreign key constraint" [superset]
zverok commented on issue #29512:
URL: https://github.com/apache/superset/issues/29512#issuecomment-4126866988
It reproduces on Superset 6.0 due to lock on "query" table. For all I can understand, if the admin user have used sqllab, they can't be removed via API.
```
IntegrityError: (psycopg2.errors.ForeignKeyViolation) update or delete on table "ab_user" violates foreign key constraint "query_user_id_fkey" on table "query"
DETAIL: Key (id)=(148) is still referenced from table "query".
[SQL: DELETE FROM ab_user WHERE ab_user.id = %(id)s]
[parameters: {'id': 148}]
```
My use case is unit tests: in an Superset instance in docker, admin users are created, use SQLLab to check custom jinja functions from our `superset_config.py`, and then deleted. Or at least that was the idea, which was struck by this bug.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org