PostgreSQL - Rename database

后端 未结 6 861
感情败类
感情败类 2020-12-23 02:27

I need to rename the database but when I do in PGAdmin : ALTER DATABASE \"databaseName\" RENAME TO \"databaseNameOld\" it told me that it cannot.

How c

6条回答
  •  悲哀的现实
    2020-12-23 03:27

    For anyone running into this issue using DBeaver and getting an error message like this:

    ERROR: database "my_stubborn_db" is being accessed by other users
      Detail: There is 1 other session using the database.
    

    Disconnect your current connection, and reconnect to the same server with a connection that doesn't target the database you are renaming.

    Changing the active database is not enough.

提交回复
热议问题