2013-02-05 61 views
20

我想在Heroku的終端這樣的檢測我的分貝:如何在heroku中使用pg:psql?

[email protected]:~/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 

所以,我想:

[email protected]:~/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. 

我需要列出所有用戶的記錄:

dbfjinfaes61gb=> select * from users 
dbfjinfaes61gb-> 

但上面沒有任何事發生,我在這裏錯過了什麼?

回答

28

您在查詢的結尾需要一個分號:

select * from users; 
+0

謝謝!是的,它的分號丟失了..現在我可以在結尾看到結果和'END',我怎麼才能繼續輸入下一個命令? – simo

+0

輸入'q'清除屏幕並返回'>'提示符 – catsby