head	1.3;
access;
symbols
	SUPPORT:1.1.1.1
	PG95-DIST:1.1.1;
locks; strict;
comment	@.\" @;


1.3
date	96.11.14.10.13.45;	author scrappy;	state dead;
branches;
next	1.2;

1.2
date	96.11.09.10.29.44;	author scrappy;	state Exp;
branches;
next	1.1;

1.1
date	96.08.18.22.14.20;	author scrappy;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	96.08.18.22.14.20;	author scrappy;	state Exp;
branches;
next	;


desc
@@


1.3
log
@Removed man pages...moved to src/man

Requested by Bryan
@
text
@.\" This is -*-nroff-*-
.\" $Header: /usr/local/cvsroot/postgres95-support/doc/man/bki.5,v 1.2 1996/11/09 10:29:44 scrappy Exp scrappy $
.TH BKI 5 11/04/96 Postgres Postgres
.SH NAME
*.bki
.SH DESCRIPTION
Backend Interface (BKI) files are scripts that are input to the postgres
backend running in the special "bootstrap" mode that allows it to perform
database functions without a database system already existing.  BKI files
can therefore be used to create the database system in the first place.
.PP
.IR Initdb
uses BKI files to do just that -- create a database system.  However,
.IR initdb's
BKI files are generated internally.  It generates them using the files
global1.bki.source and local1.template1.bki.source, which it finds in the
Postgres "library" directory.  They get installed there as part of installing
Postgres.  These .source files get build as part of the Postgres build
process, by a build program called 
.IR genbki.  Genbki
takes as input Postgres source files that double as
.IR genbki
input that builds tables and C header files that describe those
tables.
.PP
The Postgres backend interprets BKI files as described below.  This
description will be easier to understand if the global1.bki.source file is
at hand as an example.  (As explained above, this .source file isn't quite
a BKI file, but you'll be able to guess what the resulting BKI file would be
anyway).
.PP
Commands are composed of a command name followed by space separated
arguments.  Arguments to a command which begin with a \*(lq$\*(rq are
treated specially.  If \*(lq$$\*(rq are the first two characters, then
the first \*(lq$\*(rq is ignored and the argument is then processed
normally.  If the \*(lq$\*(rq is followed by space, then it is treated
as a
.SM NULL
value.  Otherwise, the characters following the \*(lq$\*(rq are
interpreted as the name of a macro causing the argument to be replaced
with the macro's value.  It is an error for this macro to be
undefined.
.PP
Macros are defined using
.nf
define macro macro_name = macro_value
.fi
and are undefined using 
.nf
undefine macro macro_name
.fi
and redefined using the same syntax as define.
.PP
Lists of general commands and macro commands
follow.
.SH "GENERAL COMMANDS"
.TP 5n
.BR "open" " classname"
Open the class called
.IR classname
for further manipulation.
.TP
.BR "close" " [classname]"
Close the open class called
.IR classname.
It is an error if 
.IR classname
is not already opened.   If no
.IR classname
is given, then the currently open class is closed.
.TP
.BR print
Print the currently open class.
.TP
.BR "insert" " [oid=oid_value] " "(" " value1 value2 ... " ")"
Insert a new instance to the open class using
.IR value1 ,
.IR value2 ,
etc., for its attribute values and 
.IR oid_value
for its OID.  If
.IR oid_value
is not \*(lq0\*(rq, then this value will be used as the instance's
object identifier.  Otherwise, it is an error.
.TP
.BR "insert (" " value1 value2 ... " ")"
As above, but the system generates a unique object identifier.
.TP
.BR "create" " classname " "(" " name1 = type1, name2 = type2, ... " ")"
Create a class named
.IR classname
with the attributes given in parentheses.
.TP
.BR "open (" " name1 = type1, name2 = type2,... " ") as" " classname"
Open a class named
.IR classname
for writing but do not record its existence in the system catalogs.
(This is primarily to aid in bootstrapping.)
.TP
.BR "destroy" " classname"
Destroy the class named
.IR classname .
.TP
.BR "define index" " index-name " "on" " class-name " "using" " amname "
( opclass attr | function({attr}) )
.br
Create an index named
.IR index_name
on the class named
.IR classname
using the
.IR amname
access method.  The fields to index are called
.IR name1 ,
.IR name2 ,
etc., and the operator collections to use are
.IR collection_1 ,
.IR collection_2 ,
etc., respectively.
.SH "MACRO COMMANDS"
.TP
.BR "define function" " macro_name " "as" " rettype function_name ( args )"
Define a function prototype for a function named
.IR macro_name
which has its value of type
.IR rettype
computed from the execution
.IR function_name
with the arguments
.IR args 
declared in a C-like manner.
.TP
.BR "define macro" " macro_name " "from file" " filename"
Define a macro named
.IR macname
which has its value 
read from the file called
.IR filename .
.\" .uh "DEBUGGING COMMANDS"
.\" .sp
.\" .in .5i
.\" r
.\" .br
.\" Randomly print the open class.
.\" .sp
.\" m	-1
.\" .br
.\" Toggle display of time information.
.\" .sp
.\" m	0
.\" .br
.\" Set retrievals to now.
.\" .sp
.\" m	1 Jan 1 01:00:00 1988
.\" .br
.\" Set retrievals to snapshots of the specfied time.
.\" .sp
.\" m	2 Jan 1 01:00:00 1988, Feb 1 01:00:00 1988
.\" .br
.\" Set retrievals to ranges of the specified times.
.\" Either time may be replaced with space
.\" if an unbounded time range is desired.
.\" .sp
.\" \&.A	classname natts name1 type1 name2 type2 ...
.\" .br
.\" Add attributes named
.\" .ul
.\" name1,
.\" .ul
.\" name2,
.\" etc. of
.\" types
.\" .ul
.\" type1,
.\" .ul
.\" type2,
.\" etc. to the
.\" .ul
.\" class
.\" classname.
.\" .sp
.\" \&.RR	oldclassname newclassname
.\" .br
.\" Rename the
.\" .ul
.\" oldclassname
.\" class to
.\" .ul
.\" newclassname.
.\" .sp
.\" \&.RA	classname oldattname newattname
.\" .br
.\" Rename the
.\" .ul
.\" oldattname
.\" attribute in the class named
.\" .ul
.\" classname
.\" to
.\" .ul
.\" newattname.
.SH EXAMPLE
The following set of commands will create the \*(lqpg_opclass\*(rq
class containing the
.IR int_ops
collection as object
.IR 421,
print out the class, and then close it.
.nf
create pg_opclass (opcname=char16)
open pg_opclass
insert oid=421 (int_ops)
print
close pg_opclass
.fi
.SH "SEE ALSO"
initdb(1),
createdb(1),
create_database(l).
@


1.2
log
@various docs changes requested by Bryan
@
text
@d2 1
a2 1
.\" $Header: /usr/local/cvsroot/postgres95-support/doc/man/bki.5,v 1.1.1.1 1996/08/18 22:14:20 scrappy Exp $
@


1.1
log
@Initial revision
@
text
@d2 2
a3 3
.\" XXX standard disclaimer belongs here....
.\" $Header: /usr/local/cvsroot/postgres95/doc/man/bki.5,v 1.6 1996/07/31 18:42:38 scrappy Exp $
.TH BKI FILES 01/23/93 Postgres95 Postgres95
d5 1
a5 1
\&.../src/backend/obj/{local,dbdb}.bki \(em template scripts
d7 5
a11 5
Backend Interface (BKI) files are scripts that describe the contents
of the initial Postgres database.  This database is constructed during
system installation, by the
.IR initdb
command.
d13 12
a24 17
executes the Postgres backend with a special set of flags, that cause it
to consume the BKI scripts and bootstrap a database.
.PP
These files are automatically generated from system header files
during installation.  They are not intended for use by humans, and you
do not need to understand their contents in order to use Postgres.  These
files are copied to
.nf
\&.../files/{global1,local1_XXX}.bki
.fi
during system installation.
.PP
All new user databases will be created by copying the template
database that Postgres constructs from the BKI files.  Thus, a simple way
to customize the template database is to let the Postgres initialization
script create it for you, and then to run the terminal monitor to make
the changes you want.
d27 4
a30 2
description will be easier to understand if the example in
\*(lq.../files/global1.bki\*(rq is at hand.
d219 1
a219 2
createdb(l),
template(files).
@


1.1.1.1
log
@Support Docs & Contrib
@
text
@@
