You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error when creating postgres databases in parallel #1283
I am using sqlx::Postgres::create_database in my test code, which runs in parallel, and I get the following error:
Database(PgDatabaseError{severity:Error,code:"55006",message:"source database \"template1\" is being accessed by other users",detail:Some("There are 2 other sessions using the database."),hint:None,position:None,where:None,schema:None,table:None,column:None,data_type:None,constraint:None,file:Some("dbcommands.c"),line:Some(528),routine:Some("createdb")})'
This is caused by this line of code. I am not familiar with postgres internals, but reading code from the createdb: /* No point in trying to use postgres db when creating postgres db. */
, it seems like we only need to switch to template1 when the database name is postgres, not when the user is postgres.
Activity
Use postgres as maintenance db unless maintaining postgres itself
Merge launchbadge/sqlx master into JetASAP/sqlx master (#12)
Update ws-support (#15)
Use postgres as maintenance db unless maintaining postgres itself (tr…