May 2018
Intermediate to advanced
576 pages
30h 25m
English
PostgreSQL starts with three databases: template0, template1, and postgres. The main user database is postgres.
You can create your own databases as well, like this:
CREATE DATABASE my_database;
You can do the same from the command line, using the following expression:
bash $ createdb my_database
After you've created your databases, make sure to secure them properly, as discussed in Chapter 6, Security.
When you create another database, it actually takes a copy of an existing database. Once it is created, there is no further link between the two databases.
The template0 and template1 databases are known as template databases. The template1 database can be changed to allow you to create a localized template for any new databases ...