PostgreSQL-重命名数据库 [英] PostgreSQL - Rename database

查看:240
本文介绍了PostgreSQL-重命名数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要重命名数据库,但是当我在
PGAdmin中进行操作时:ALTER DATABASE databaseName重命名为 databaseNameOld 它告诉我不能。

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

我该怎么办?

WindowsXP上的8.3版

更新


  • 第一个错误信息:无法连接,因为我已连接到它。因此,我选择了另一个数据库并进行了查询。

  • The first error message : Cannot because I was connect to it. So I selected an other database and did the queries.

我收到第二条错误消息,告诉我它已经连接了用户。我在 PGAdmin 屏幕上看到它具有许多 PID ,但是它们是不活动的...我看不到如何

I get a second error message telling me that it has come user connect. I see in the PGAdmin screen that it has many PID but they are inactive... I do not see how to kill them.

推荐答案

尝试不引用数据库名称:

Try not quoting the database name:

ALTER DATABASE people RENAME TO customers;

还要确保当时没有其他客户端连接到数据库。最后,尝试发布返回的错误消息,以便我们获取更多信息。

Also ensure that there are no other clients connected to the database at the time. Lastly, try posting the error message it returns so we can get a bit more information.

这篇关于PostgreSQL-重命名数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆