51.2. BKI Commands

create [bootstrap] [shared_relation] [without_oids] nome_da_tabela (nome1 = tipo1 [, nome2 = type2, ...])

Create a table named tablename with the columns given in parentheses.

The following column types are supported directly by bootstrap.c: bool, bytea, char (1 byte), name, int2, int4, regproc, regclass, regtype, text, oid, tid, xid, cid, int2vector, oidvector, _int4 (array), _text (array), _aclitem (array). Although it is possible to create tables containing columns of other types, this cannot be done until after pg_type has been created and filled with appropriate entries.

When bootstrap is specified, the table will only be created on disk; nothing is entered into pg_class, pg_attribute, etc, for it. Thus the table will not be accessible by ordinary SQL operations until such entries are made the hard way (with insert commands). This option is used for creating pg_class etc themselves.

The table is created as shared if shared_relation is specified. It will have OIDs unless without_oids is specified.

open nome_da_tabela

Open the table called nome_da_tabela for further manipulation.

close [nome_da_tabela]

Close the open table called tablename. It is an error if nome_da_tabela is not already opened. If no tablename is given, then the currently open table is closed.

insert [OID = valor_do_oid] (valor1 valor2 ...)

Insert a new row into the open table using value1, value2, etc., for its column values and oid_value for its OID. If valor_do_oid is zero (0) or the clause is omitted, then the next available OID is used.

NULL values can be specified using the special key word _null_. Values containing spaces must be double quoted.

declare [unique] index indexname on tablename using amname (opclass1 name1 [, ...])

Create an index named indexname on the table named nome_da_tabela using the amname access method. The fields to index are called name1, name2 etc., and the operator classes to use are opclass1, opclass2 etc., respectively. The index file is created and appropriate catalog entries are made for it, but the index contents are not initialized by this command.

build indices

Fill in the indices that have previously been declared.

SourceForge.net Logo CSS válido!