psql似乎无法正常工作 [英] psql appears not to be working
问题描述
我刚刚安装了Postgres服务器,但使用psql遇到了问题。每当我进入 psql
shell时,所有命令均无效。例如:
I've just installed the Postgres server and I'm running into a problem using psql. Whenever I'm in the psql
shell none of the commands have any effect. For example:
postgres=# create database testing
postgres=# create user foo
据我了解,我应该看到以下内容:
It's my understanding that I should see something like this:
postgres=# create database testing
CREATE DATABASE
postgres=# create user foo
CREATE ROLE
奇怪的是,我可以使用shell命令来创建数据库和角色。我已经从 ppa:pitti / postgresql
中安装了postgres,安装在原始版本的Ubuntu 10.04上(根据railscast#335)。
The weird thing is I can use the shell commands to make the database and roles. I've installed postgres from ppa:pitti/postgresql
on a vanilla install of Ubuntu 10.04 (as per railscast #335).
我在Google上花费了相当长的时间,试图弄清我的问题是什么,但是我似乎无法得到任何答案。
I've spent a fair amount of time on google trying to figure out what's my problem is but I can't seem to get any answers.
谢谢
推荐答案
您可能没有看到,因为您没有使用分号(;)结束一行。您的示例应写为:
You're probably not seeing that because you're not finishing the line with a semicolon (;). Your examples should be written as:
postgres=# CREATE DATABASE testing;
postgres=# CREATE ROLE foo;
这篇关于psql似乎无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!