How to do it...

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:

  1. 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
  1. 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 ...

Get PostGIS Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.