1

First off, let me say that I'm new to both using Mac and PostgreSQL. I just installed Postgres using their installer and it was installed in /Library/Postgres/... when I tried running createdb from the terminal it returned an error createdb: command not found. I ended up using /library/postgresql/9.6/bin/createdb before I coud get it to work. Here's my question, how do I set it so that I don't have to type in the full path again to use the createdb command. I'd love a detailed explanation. Thanks

1 Answer 1

3

First you need to execute the psql command to get into the postgresql interacive shell.

In your terminal:

psql

Postgresql interactive shell should start. In this shell

> createdb yourdatabasename;

Btw: If psql is not found you will probably need to add it to your path and restart your terminal, something like this with the path matching your machine:

export PATH=/Library/PostgreSQL/9.5/bin:$PATH
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.