"Dmitry Koterov" <dmitry@xxxxxxxxxx> writes: > I have a database which I cannot delete (the same for rename): > ERROR: database "xxx" is being accessed by other users > But it is NOT accessed by anybody, because: Have you checked for prepared transactions in that DB? See pg_prepared_xacts view (I've been burnt by that myself...) regards, tom lane