1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Chapter51.BKI Backend Interface</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<link rev="made" href="pgsql-docs@postgresql.org">
<meta name="generator" content="DocBook XSL Stylesheets V1.70.0">
<link rel="start" href="index.html" title="PostgreSQL 8.1.4 Documentation">
<link rel="up" href="internals.html" title="PartVII.Internals">
<link rel="prev" href="storage-page-layout.html" title="50.3.Database Page Layout">
<link rel="next" href="bki-commands.html" title="51.2.BKI Commands">
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" lang="en" id="bki">
<div class="titlepage"><div><div><h2 class="title">
<a name="bki"></a>Chapter51.<acronym class="acronym">BKI</acronym> Backend Interface</h2></div></div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl>
<dt><span class="sect1"><a href="bki.html#bki-format">51.1. <acronym class="acronym">BKI</acronym> File Format</a></span></dt>
<dt><span class="sect1"><a href="bki-commands.html">51.2. <acronym class="acronym">BKI</acronym> Commands</a></span></dt>
<dt><span class="sect1"><a href="bki-structure.html">51.3. Structure of the Bootstrap <acronym class="acronym">BKI</acronym> File</a></span></dt>
<dt><span class="sect1"><a href="bki-example.html">51.4. Example</a></span></dt>
</dl>
</div>
<p> Backend Interface (<acronym class="acronym">BKI</acronym>) files are scripts in a
special language that is understood by the
<span class="productname">PostgreSQL</span> backend when running in the
“<span class="quote">bootstrap</span>” mode. The bootstrap mode allows system catalogs
to be created and filled from scratch, whereas ordinary SQL commands
require the catalogs to exist already.
<acronym class="acronym">BKI</acronym> files can therefore be used to create the
database system in the first place. (And they are probably not
useful for anything else.)
</p>
<p> <span class="application">initdb</span> uses a <acronym class="acronym">BKI</acronym> file
to do part of its job when creating a new database cluster. The
input file used by <span class="application">initdb</span> is created as
part of building and installing <span class="productname">PostgreSQL</span>
by a program named <code class="filename">genbki.sh</code>, which reads some
specially formatted C header files in the <code class="filename">src/include/catalog/</code>
directory of the source tree. The created
<acronym class="acronym">BKI</acronym> file is called <code class="filename">postgres.bki</code> and is
normally installed in the
<code class="filename">share</code> subdirectory of the installation tree.
</p>
<p> Related information may be found in the documentation for
<span class="application">initdb</span>.
</p>
<div class="sect1" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="bki-format"></a>51.1.<acronym class="acronym">BKI</acronym> File Format</h2></div></div></div>
<p> This section describes how the <span class="productname">PostgreSQL</span>
backend interprets <acronym class="acronym">BKI</acronym> files. This description
will be easier to understand if the <code class="filename">postgres.bki</code>
file is at hand as an example.
</p>
<p> <acronym class="acronym">BKI</acronym> input consists of a sequence of commands. Commands are made up
of a number of tokens, depending on the syntax of the command.
Tokens are usually separated by whitespace, but need not be if
there is no ambiguity. There is no special command separator; the
next token that syntactically cannot belong to the preceding
command starts a new one. (Usually you would put a new command on
a new line, for clarity.) Tokens can be certain key words, special
characters (parentheses, commas, etc.), numbers, or double-quoted
strings. Everything is case sensitive.
</p>
<p> Lines starting with <code class="literal">#</code> are ignored.
</p>
</div>
</div></body>
</html>
|