Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
createtablenametableoid [bootstrap] [shared_relation] [without_oids] [rowtype_oidoid] (name1 =type1 [FORCE NOT NULL | FORCE NULL] [,name2 =type2 [FORCE NOT NULL | FORCE NULL], ...])

Create a table namedtablename, and having the OIDtableoid, with the columns given in parentheses.

The following column types are supported directly bybootstrap.c:bool,bytea,char (1 byte),name,int2,int4,regproc,regclass,regtype,text,oid,tid,xid,cid,int2vector,oidvector,_int4 (array),_text (array),_oid (array),_char (array),_aclitem (array). Although it is possible to create tables containing columns of other types, this cannot be done until afterpg_type has been created and filled with appropriate entries. (That effectively means that only these column types can be used in bootstrapped tables, but non-bootstrap catalogs can contain any built-in type.)

Whenbootstrap is specified, the table will only be created on disk; nothing is entered intopg_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 (withinsert commands). This option is used for creatingpg_class etc themselves.

The table is created as shared ifshared_relation is specified. It will have OIDs unlesswithout_oids is specified. The table's row type OID (pg_type OID) can optionally be specified via therowtype_oid clause; if not specified, an OID is automatically generated for it. (Therowtype_oid clause is useless ifbootstrap is specified, but it can be provided anyway for documentation.)

opentablename

Open the table namedtablename for insertion of data. Any currently open table is closed.

close [tablename]

Close the open table. The name of the table can be given as a cross-check, but this is not required.

insert [OID =oid_value](value1value2 ...)

Insert a new row into the open table usingvalue1,value2, etc., for its column values andoid_value for its OID. Ifoid_value is zero (0) or the clause is omitted, and the table has OIDs, then the next available OID is assigned.

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

declare [unique]indexindexnameindexoidontablenameusingamname(opclass1name1 [, ...])

Create an index namedindexname, having OIDindexoid, on the table namedtablename, using theamname access method. The fields to index are calledname1,name2 etc., and the operator classes to use areopclass1,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.

declare toasttoasttableoidtoastindexoidontablename

Create a TOAST table for the table namedtablename. The TOAST table is assigned OIDtoasttableoid and its index is assigned OIDtoastindexoid. As withdeclare index, filling of the index is postponed.

build indices

Fill in the indices that have previously been declared.


Prev Home Next
62.1. BKI File Format Up 62.3. Structure of the Bootstrap BKI File
pdfepub
Go to Postgres Pro Standard 9.6
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp