37

I am trying to detect my db at heroku terminal like this:

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

So, I tried:

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.

I need to list all users records:

dbfjinfaes61gb=> select * from users
dbfjinfaes61gb-> 

But above, nothing happened, what I am missing here?

simo
  • 23,342
  • 38
  • 121
  • 218

2 Answers2

46

You need a semicolon at the end of the query:

select * from users;
Clodoaldo Neto
  • 118,695
  • 26
  • 233
  • 260
  • Thanks! yes its the semicolon was missing .. now I can see the result and 'END' at the end of it, how can I proceed to enter the next command? – simo Feb 06 '13 at 02:29
13

Run this

heroku pg:psql -c "command" --app "name-app"

sample

heroku pg:psql -c "\?" --app app-sample
Leonardo Pineda
  • 990
  • 8
  • 10