Carry out the following steps to create and organize a database:
- Create a database named chapter10 by executing the following command:
CREATE DATABASE chapter10;
- Create a schema named postgis in the chapter10 database, where we will install PostGIS. Execute the following command:
CREATE SCHEMA postgis;
- Install PostGIS in the postgis schema of the chapter10 database:
- If you are running PostgreSQL 9.1 or a newer version, use the CREATE EXTENSION statement:
CREATE EXTENSION postgis WITH SCHEMA postgis;
The WITH SCHEMA clause of the CREATE EXTENSION statement instructs PostgreSQL to install PostGIS and its objects in the postgis schema.
- Check whether or not the PostGIS installation has succeeded by running the following ...