home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre2.z / postgre2 / ref / files / bki next >
Encoding:
Text File  |  1992-08-27  |  5.7 KB  |  311 lines

  1. .\" XXX standard disclaimer belongs here....
  2. .\" $Header: /private/postgres/ref/files/RCS/bki,v 1.8 1992/07/14 05:54:17 ptong Exp $
  3. .SP BKI FILES 6/14/90
  4. .XA 1 "Backend Interface \*- BKI"
  5. .uh NAME
  6. .lp
  7. \&.../src/support/{local,dbdb}.bki \*- template scripts
  8. .uh DESCRIPTION
  9. .lp
  10. Backend Interface (BKI) files are scripts that describe
  11. the contents of the initial \*(PP database.
  12. This database is constructed during system installation,
  13. by the
  14. .b initdb
  15. command.
  16. .b Initdb
  17. executes the \*(PP backend with a special set of flags,
  18. that cause it to consume the BKI scripts and bootstrap
  19. a database.
  20. .lp
  21. These files are automatically generated from system header
  22. files during installation.
  23. They are not intended for use by humans,
  24. and you do not need to understand their contents in order
  25. to use \*(PP.
  26. These files are copied to .../files/local1.bki
  27. and .../files/global1.bki during system installation.
  28. .lp
  29. All new user databases will be created by copying the template
  30. database that \*(PP constructs from the BKI files.
  31. Thus,
  32. a simple way to customize the template database is to
  33. let the \*(PP initialization script create it for you,
  34. and then to run the terminal monitor to make the changes
  35. you want.
  36. .lp
  37. The \*(PP backend
  38. interprets BKI files as described below.
  39. This description will be easier to understand
  40. if the example in  .../files/global1.bki is at hand.
  41. .lp
  42. Commands are composed of a command
  43. name followed by space separated arguments.
  44. Arguments to a command which begin with
  45. a
  46. .q $
  47. are treated specially.
  48. If
  49. .q $$
  50. are the first two characters, then
  51. the first
  52. .q $
  53. is ignored and the argument
  54. is then processed normally.
  55. If the
  56. .q $
  57. is followed by space,
  58. then it is treated as a
  59. .A NULL
  60. value.
  61. Otherwise, the characters following the
  62. .q $
  63. are interpreted as the name of a macro
  64. causing the argument to be replaced with the macro's value.
  65. It is an error for this macro to be undefined.
  66. .lp
  67. Macros are defined using
  68. "define macro macro_name = macro_value"
  69. and are undefined using 
  70. "undefine macro macro_name"
  71. and redefined using the same syntax as define.
  72. .sp
  73. Lists of general commands and macro commands
  74. follow.
  75. .uh "GENERAL COMMANDS"
  76. .lp
  77. .ft C
  78. open classname
  79. .ft
  80. .sp
  81. Open the class called
  82. .i classname
  83. for further manipulation.
  84. .sp
  85. .ft C
  86. close [classname]
  87. .ft
  88. .sp
  89. Close the open class called
  90. .i classname.
  91. It is an error if 
  92. .i classname
  93. is not already opened.   If no
  94. .i classname
  95. is given, then the 
  96. currently open class is closed.
  97. .sp
  98. .ft C
  99. print
  100. .ft
  101. .sp
  102. Print the currently open class.
  103. .sp
  104. .ft C
  105. insert [ oid= oid_value ] '(' value1 value2 ...')'
  106. .ft
  107. .sp
  108. Insert a new instance to the open
  109. class using
  110. .ul
  111. value1,
  112. .ul
  113. value2,
  114. etc. for its attribute values and oid_value for it's OID.
  115. If
  116. .ul
  117. oid
  118. is not \*(lq0\*(rq, then this value
  119. will be used as the instance's
  120. object identifier.
  121. Otherwise, it is an error.
  122. To let the system generate a unique object identifier (as opposed to the
  123. "well-known" object identifiers which we specify) use 
  124. insert '(' value1, value2, ... valuen ')' .
  125.  
  126. .sp
  127. .ft C
  128. create classname '(' name1 = type1,
  129.                      name2 = type2, ...name n = type n ')'
  130. .ft
  131. .sp
  132. Create a class named
  133. .ul
  134. classname
  135. with the attributes given in parentheses.
  136. .sp
  137. .ft C
  138. open '('name1 = type1, name2 = type2,...name n = type n ')'
  139.     as classname
  140. .ft
  141. .sp
  142. Open a class named
  143. .ul
  144. classname
  145. for writing 
  146. but do not record its existence
  147. in the system catalogs.  (This is primarily to aid in bootstrapping.)
  148. .sp
  149. .ft C
  150. destroy classname
  151. .ft
  152. .sp
  153. Destroy the class named
  154. .ul
  155. classname.
  156. .sp
  157. .ft C
  158. define index <index-name> on <class-name> using <amname>
  159.     ( <opclass> <attr> | function({attr}) )
  160. .ft
  161. .sp
  162. Create an index named
  163. .ul
  164. index_name
  165. on the class named
  166. .ul
  167. classname
  168. using the
  169. .ul
  170. amname
  171. access method.
  172. The fields to index are called
  173. .ul
  174. name1,
  175. .ul
  176. name2,
  177. etc. and the operator
  178. collections to use are
  179. .ul
  180. collection_1,
  181. .ul
  182. collection_2,
  183. etc., respectively.
  184. .uh "MACRO COMMANDS"
  185. .lp
  186. .ft C
  187. define function macro_name
  188.        as rettype function_name ( args )
  189. .ft
  190. .sp
  191. Define a function prototype for a function named
  192. .ul
  193. macro_name
  194. which has its value of type
  195. .ul
  196. rettype
  197. computed from the
  198. execution
  199. .ul
  200. function_name
  201. with the
  202. .ul
  203. arguments
  204. .ul
  205. args 
  206. declared in a C-like manner
  207. etc.
  208. .sp
  209. .ft C
  210. define macro macro_name from file filename
  211. .ft
  212. .sp
  213. Define a macro named
  214. .ul
  215. macname
  216. which has its value 
  217. read from the file called
  218. .ul
  219. filename.
  220. .sp
  221.  
  222. .\" .uh "DEBUGGING COMMANDS"
  223. .\" .sp
  224. .\" .in .5i
  225. .\" r
  226. .\" .br
  227. .\" Randomly print the open class.
  228. .\" .sp
  229. .\" m    -1
  230. .\" .br
  231. .\" Toggle display of time information.
  232. .\" .sp
  233. .\" m    0
  234. .\" .br
  235. .\" Set retrievals to now.
  236. .\" .sp
  237. .\" m    1 Jan 1 01:00:00 1988
  238. .\" .br
  239. .\" Set retrievals to snapshots of the specfied time.
  240. .\" .sp
  241. .\" m    2 Jan 1 01:00:00 1988, Feb 1 01:00:00 1988
  242. .\" .br
  243. .\" Set retrievals to ranges of the specified times.
  244. .\" Either time may be replaced with space
  245. .\" if an unbounded time range is desired.
  246. .\" .sp
  247. .\" \&.A    classname natts name1 type1 name2 type2 ...
  248. .\" .br
  249. .\" Add attributes named
  250. .\" .ul
  251. .\" name1,
  252. .\" .ul
  253. .\" name2,
  254. .\" etc. of
  255. .\" types
  256. .\" .ul
  257. .\" type1,
  258. .\" .ul
  259. .\" type2,
  260. .\" etc. to the
  261. .\" .ul
  262. .\" class
  263. .\" classname.
  264. .\" .sp
  265. .\" \&.RR    oldclassname newclassname
  266. .\" .br
  267. .\" Rename the
  268. .\" .ul
  269. .\" oldclassname
  270. .\" class to
  271. .\" .ul
  272. .\" newclassname.
  273. .\" .sp
  274. .\" \&.RA    classname oldattname newattname
  275. .\" .br
  276. .\" Rename the
  277. .\" .ul
  278. .\" oldattname
  279. .\" attribute in the class named
  280. .\" .ul
  281. .\" classname
  282. .\" to
  283. .\" .ul
  284. .\" newattname.
  285. .uh EXAMPLE
  286. .lp
  287. The following set of commands will create the
  288. OPCLASS class containing
  289. the
  290. .i int_ops
  291. collection as object
  292. .i 421,
  293. print out the class, and then close it.
  294. .sp
  295. .nf
  296. .ft C
  297. create pg_opclass (opcname=char16)
  298. open pg_opclass
  299. insert oid=421 (int_ops)
  300. print
  301. close pg_opclass
  302. .ft
  303.  
  304. .fi
  305. .uh "SEE ALSO"
  306. .lp
  307. initdb(unix),
  308. createdb(unix),
  309. createdb(commands),
  310. template(files).
  311.