How to do it...

On the command line, perform the following steps:

  1. Even though a backup file was created in this chapter's third recipe, create a new backup file by executing the following command:
      > pg_dump -U me -f chapter10.backup -F custom chapter10
  1. Create a new database to which the backup file will be restored by executing the following commands:
      > psql -d postgres -U me
      postgres=# CREATE DATABASE new10;
  1. Connect to the new10, database and create a postgis schema as follows:
      postgres=# \c new10
      new10=# CREATE SCHEMA postgis;
  1. Execute the CREATE EXTENSION command to install the Postgis extension in the postgis schema:
      new10=# CREATE EXTENSION postgis WITH SCHEMA postgis;
  1. Make sure you set the search_path parameter to include ...

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.