0

I have installed Postgres.app in Mac, and I have set the PATH variable to run the psql command.

enter image description here

Now I would like to create a new user and new database for a project that I'm creating. Nevertheless, when I execute a new command in terminal, it doesn't prompt me anything, and I don't know if my command was executed correctly.

Even if I write dummy words, it doesn't tell me anything:

enter image description here

Also, if I want to enter to the postgres user, it doesn't allow me, sending me the next error:

enter image description here

Does anyone know what is happening?.

Regards.

Erik Barajas
  • 193
  • 2
  • 12
  • I believe you need to terminate a postgresql command with a semicolon. As for logging in as postgres, I'm not sure. – user2027202827 Aug 29 '16 at 17:31
  • 1
    See also: http://stackoverflow.com/q/13321005/330315 –  Aug 29 '16 at 17:35
  • 2
    First things first - every SQL command needs to end with a delimiter which happens to be `;`. Also, commands like `createdb` and `createuser` are not to be invoked from within `psql`, but from the console itself. Of course, there are equivalents like `CREATE DATABASE ` or `CREATE USER [WITH] `. – Kamil Gosciminski Aug 29 '16 at 17:35
  • And for example, if I want to run it from bash, why does it tell me that the user postgres doesn't exist? – Erik Barajas Aug 29 '16 at 17:42

1 Answers1

1

You have to append ; to each of your PostgreSQL - commands.

mm759
  • 1,404
  • 1
  • 9
  • 7