February 2020
Intermediate to advanced
404 pages
8h 42m
English
Now, we can create a new user and database. For this, we are going to use Ubuntu/MacOS X as a general example. We do this in a shell called the psql shell. We can see all available commands in psql using the \? command. In order to enter the psql shell, first, change to the postgres user. On Ubuntu, for universal installation, you can enter the psql shell using the following command:
sudo su postgres
Now, it turns us into a user called postgres. Then, launch the psql shell using the following command:
psql
In the case of PostgreSQL running in a Docker container, use this command to launch the psql shell directly:
docker exec -i -t postgres-local-1 psql -U postgres
Once you are in the psql shell, type ...
Read now
Unlock full access