14

I'm a complete noob to PostgreSQL, so I'm probably missing something completely obvious.

Connected to my local db via psql on terminal. Any command I run to make db changes, or even a simple select does nothing. No error, just no results.

I can use the shell commands createdb, dropdb just fine.

Got a site running in Ruby on Rails, RefineryCMS, using the local PostgreSQL db, so I know the db has data and is working - I just can't seem to query or modify it via psql.

What am I missing?

Mac OS X Lion, pg v 9.2.

  • thanks for posting and providing your solution - I think the issue you had is 'too localized' to be of benefit to others so on that basis I'm closing. – Jack Douglas Sep 24 '12 at 7:48
  • 3
    As a note, as someone who has supported PostgreSQL for others, this is remarkably common. – Chris Travers Sep 30 '12 at 3:13
  • 6
    Very disappointed that this has been closed, since I'm having the same problem on a windows machine, and the solution is not simply adding a semicolon. The issue begins at random, and I have to restart the postgres service in order for queries to even be responsive. – Amalgovinus May 28 '15 at 0:07
  • 1
    Same problem on linux with a python CMS. This question is not too localized. – Ortomala Lokni Oct 20 '16 at 13:34
21

Jumped on the IRC postgresql channel and had this answered in 30 seconds.

Issue was that I was not ending my SQL commands with a semicolon. Doh!

| improve this answer | |
  • 2
    As a note, you can tell the context of a line by looking at the prompt. Usually the prompt looks something like [dbname][line status][user rights]. Line status can be a type of quote, an = for a new line or a - for continuation. User rights are # for superuser or > for non-super-user. – Chris Travers Sep 30 '12 at 3:16
  • Glorry be upon you – BamBam22 May 15 at 2:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.