]> begriffs open source - ai-pg/blob - full-docs/txt/bki-commands.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / bki-commands.txt
1
2 68.4. BKI Commands #
3
4    create tablename tableoid [bootstrap] [shared_relation] [rowtype_oid
5           oid] (name1 = type1 [FORCE NOT NULL | FORCE NULL ] [, name2 =
6           type2 [FORCE NOT NULL | FORCE NULL ], ...])
7           Create a table named tablename, and having the OID tableoid,
8           with the columns given in parentheses.
9
10           The following column types are supported directly by
11           bootstrap.c: bool, bytea, char (1 byte), name, int2, int4,
12           regproc, regclass, regtype, text, oid, tid, xid, cid,
13           int2vector, oidvector, _int4 (array), _text (array), _oid
14           (array), _char (array), _aclitem (array). Although it is
15           possible to create tables containing columns of other types,
16           this cannot be done until after pg_type has been created and
17           filled with appropriate entries. (That effectively means that
18           only these column types can be used in bootstrap catalogs, but
19           non-bootstrap catalogs can contain any built-in type.)
20
21           When bootstrap is specified, the table will only be created on
22           disk; nothing is entered into pg_class, pg_attribute, etc., for
23           it. Thus the table will not be accessible by ordinary SQL
24           operations until such entries are made the hard way (with insert
25           commands). This option is used for creating pg_class etc.
26           themselves.
27
28           The table is created as shared if shared_relation is specified.
29           The table's row type OID (pg_type OID) can optionally be
30           specified via the rowtype_oid clause; if not specified, an OID
31           is automatically generated for it. (The rowtype_oid clause is
32           useless if bootstrap is specified, but it can be provided anyway
33           for documentation.)
34
35    open tablename
36           Open the table named tablename for insertion of data. Any
37           currently open table is closed.
38
39    close tablename
40           Close the open table. The name of the table must be given as a
41           cross-check.
42
43    insert ( [oid_value] value1 value2 ... )
44           Insert a new row into the open table using value1, value2, etc.,
45           for its column values.
46
47           NULL values can be specified using the special key word _null_.
48           Values that do not look like identifiers or digit strings must
49           be single-quoted. (To include a single quote in a value, write
50           it twice. Escape-string-style backslash escapes are allowed in
51           the string, too.)
52
53    declare [unique] index indexname indexoid on tablename using amname (
54           opclass1 name1 [, ...] )
55           Create an index named indexname, having OID indexoid, on the
56           table named tablename, using the amname access method. The
57           fields to index are called name1, name2 etc., and the operator
58           classes to use are opclass1, opclass2 etc., respectively. The
59           index file is created and appropriate catalog entries are made
60           for it, but the index contents are not initialized by this
61           command.
62
63    declare toast toasttableoid toastindexoid on tablename
64           Create a TOAST table for the table named tablename. The TOAST
65           table is assigned OID toasttableoid and its index is assigned
66           OID toastindexoid. As with declare index, filling of the index
67           is postponed.
68
69    build indices
70           Fill in the indices that have previously been declared.