Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Problem

Info

An error similar to the following occurs when trying to drop a PostgreSQL database.


An error has occurred:
ERROR: database "ForayAdams" is being accessed by other users DETAIL:  There are 3 prepared transactions using the database.

Solution

Prepared transactions are in-process transactions.  If you are dropping the database then you most likely don't care about them.  To view all prepared transactions run:

Code Block
SELECT * FROM pg_prepared_xacts;

To drop a specific transaction run:

Code Block
ROLLBACK PREPARED '<THE GID>';

Ex: ROLLBACK PREPARED '131075_MS03ZjAwMDEzYTo0YTg5MjA5NzoxMDczMg==';

...

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@8cd
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ( "postgres" , "database" , "prepared" , "transactions" , "rollback" ) and type = "page" and space = "FS"
labelspostgres database

...