Skip to content

sqlx::test fails with "permission denied for table pg_namespace" #2051

Answered by abonander
jangerhard asked this question in Q&A
Discussion options

You must be logged in to vote

The user credentials you use with #[sqlx::test] need superuser permissions since they create and drop databases. The specific permission check that's failing there is the need for a LOCK grant on the pg_catalog.pg_namespace table in some_database as it also creates a _sqlx_test schema to host the objects it uses to track the databases it's created so it can clean them up later.

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@sassman
Comment options

Answer selected by abonander
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@alextes
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #2050 on August 15, 2022 22:05.