0

Possible Duplicate:
In psql, why do some commands have no effect?

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

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).

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.

Thanks.

Community
  • 1
  • 1
Clay
  • 319
  • 2
  • 15

2 Answers2

3

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;
titanofold
  • 2,852
  • 1
  • 15
  • 21
  • Well, I feel silly now... :P A bit surprised that it didn't complain though. – Clay Nov 03 '12 at 21:50
  • 1
    @Clay How would it know to complain? It's perfectly valid (and useful) to split SQL statements over several lines for easy editing, readability, etc. – Craig Ringer Nov 04 '12 at 00:55
1

Are you sure your commands are terminated by the ;? All statements issued from psql should be terminated by the semicolon, unless you've specified -S switch when invoking psql.

Another way to send the query buffer for execution is to issue \g meta-command.

vyegorov
  • 21,787
  • 7
  • 59
  • 73