Because we created an isolated instance of your postgres database, we have to recreate to use, database name and schema. These operations are optional. However, we encourage you to follow this to make this recipe consistent with the rest of the book:
- Create the user me in your container:
root@d842288536c9:/# psql -U postgres psql (10.1) Type "help" for help. postgres=# CREATE USER me WITH PASSWORD 'me'; CREATE ROLE postgres=# ALTER USER me WITH SUPERUSER; ALTER ROLE
- Reconnect to the database but now as user me to create database and schema:
root@d842288536c9:/# PGPASSWORD=me psql -U me -d postgres postgres=# CREATE DATABASE "postgis-cookbook"; CREATE DATABASE postgres=# \c postgis-cookbook
You are now connected to database ...