/plushcap/analysis/supabase/what-are-postgresql-templates

What are PostgreSQL Templates?

What's this blog post about?

PostgreSQL Templates are standard system databases that exist in every newly created database cluster, including template1 and template0. By default, new databases are created from the template1 database, which can be modified to include custom tables, data, extensions, or procedural languages. However, it is not advisable to modify template1 directly as any changes made would need to be manually uninstalled or dropped. Instead, users can create their own custom template databases and set them as templates for new databases. The template0 database serves as a fallback in case anything irreversible happens to template1. It contains the same data as template1 but should never be modified after the database cluster has been initialized.

Company
Supabase

Date published
July 9, 2020

Author(s)
Angelico de los Reyes

Word count
664

Hacker News points
None found.

Language
English


By Matt Makai. 2021-2024.