如何在heroku中使用pg:psql?

sim*_*imo 30 postgresql heroku ruby-on-rails-3.1

我试图在heroku终端检测我的数据库,如下所示:

myapp@ubuntu:~/RubymineProjects/myapp$ heroku pg:info
The plugin heroku-sql-console has been deprecated. Would you like to remove it? (y/N) n
=== HEROKU_POSTGRESQL_JADE_URL (DATABASE_URL)
Plan:        Dev
Status:      available
Connections: 1
PG Version:  9.1.6
Created:     2012-10-10 19:59 UTC
Data Size:   9.1 MB
Tables:      32
Rows:        2802/10000 (In compliance)
Fork/Follow: Unsupported
Run Code Online (Sandbox Code Playgroud)

所以,我尝试过:

myapp@ubuntu:~/RubymineProjects/myapp$ heroku pg:psql
The plugin heroku-sql-console has been deprecated. Would you like to remove it? (y/N) n
psql (9.1.7, server 9.1.6)
SSL connection (cipher: **-**-****-**, bits: 256)
Type "help" for help.
Run Code Online (Sandbox Code Playgroud)

我需要列出所有用户记录:

dbfjinfaes61gb=> select * from users
dbfjinfaes61gb-> 
Run Code Online (Sandbox Code Playgroud)

但是上面,没有发生任何事情,我在这里失踪了什么?

Clo*_*eto 37

在查询结束时需要一个分号:

select * from users;
Run Code Online (Sandbox Code Playgroud)


Leo*_*eda 8

运行这个

heroku pg:psql -c "command" --app "name-app"
Run Code Online (Sandbox Code Playgroud)

样品

heroku pg:psql -c "\?" --app app-sample
Run Code Online (Sandbox Code Playgroud)