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.

4
  • I believe you need to terminate a postgresql command with a semicolon. As for logging in as postgres, I'm not sure. Commented Aug 29, 2016 at 17:31
  • 1
    See also: stackoverflow.com/q/13321005/330315 Commented Aug 29, 2016 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 <name> or CREATE USER <name> [WITH] <options>. Commented Aug 29, 2016 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? Commented Aug 29, 2016 at 17:42

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.