postgres 重命名数据库不起作用 [英] postgres rename database not working
本文介绍了postgres 重命名数据库不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,看上面的代码,我没能将cx111重命名为cx 222,知道吗?非常感谢.
解决方案
您需要用分号终止 ALTER 语句.
你输入的方式,它永远不会被执行,因为 psql 正在等待语句完成.
bin]# ./createdb cx123 -U postgres [bin]# ./createdb cx111 -U postgres [bin]# ./psql -d cx123 -U postgres Welcome to psql 8.3.7, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit cx123=# ALTER DATABASE cx111 RENAME TO cx222 cx123-# \q [bin]# ./psql -l -U postgres List of databases Name | Owner | Encoding -----------+----------+---------- cx111 | postgres | UTF8 cx123 | postgres | UTF8 (2 rows) ###################################################
Hi guys, See the above code, I failed to rename cx111 to cx 222, any idea? Thanks a lot.
解决方案
You need to terminate the ALTER statement with a semicolon.
The way you typed it, it never got executed because psql was waiting for the statement to be finished.
这篇关于postgres 重命名数据库不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文