TEMPLATE(FILES)

Template

NAME
.../data/files/global1.bki — global database template
.../data/files/local1_XXX.bki — local database template
.../data/files/template1/* — default database template

DESCRIPTION
These files contain scripts which direct the construction of databases. Note that the “global1.bki” and “template1_local.bki” files are installed automatically when the Postgres super-user runs initdb. These files are copied from
.../src/backend/obj/{dbdb,local}.bki
The databases which are generated by the template scripts are normal databases. Consequently, you can use the terminal monitor or some other frontend on a template database to simplify the customization task. That is, there is no need to express everything about your desired initial database state using a BKI template script, because the database state can be tuned interactively.

The system catalogs consist of classes of two types: global and local. There is one copy of each global class that is shared among all databases at a site. Local classes, on the other hand, are not accessible except from their own database.

The file
.../data/files/global1.bki
specifies the process used in the creation of global (shared) classes by createdb. Similarly, the
.../files/local1_XXX.bki
files specify the process used in the creation of local (unshared) catalog classes for the “XXX” template database. “XXX” may be any string of 16 or fewer printable characters. If no template is specified in a createdb command, then the template in
.../files/local1_template1.bki
is used.

The .bki files are generated from C source code by an inscrutable set of AWK scripts.

BUGS
Postgres Version does not permit users to have separate template databases.

SEE ALSO
bki(files), initdb(1), createdb(1).