Creating a Spatial Database
The template1
database is the
default system template used when creating new databases. Don't use it as an operational database!
Instead, create a new database for your projects. New databases are
created using the command-line program createdb
, followed by the name that identifies
the new database:
> createdb project1
CREATE DATABASE
In this case, the new database is called project1
. The text that is printed out
(CREATE
DATABASE
) confirms that the command ran and
finished. Now when existing databases are listed, project1
should be included:
> psql -l
List of databases
Name | Owner | Encoding
------------+----------+-----------
project1 | tyler | SQL_ASCII
template0 | postgres | SQL_ASCII
template1 | postgres | SQL_ASCII
(3 rows)
The project1
database is now
ready for data loading. To quit psql,
use the \q
command.
Get Web Mapping Illustrated 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.