71.5. Structure of the Bootstrap BKI File

|71.5. Structure of the Bootstrap BKI File|              |                                                            |                  |                         |
|:---------------------------------------:|--------------|------------------------------------------------------------|------------------|-------------------------|
|        [Prev](bki-commands.html)        |[Up](bki.html)|Chapter 71. System Catalog Declarations and Initial Contents|[Home](index.html)| [Next](bki-example.html)|

---

## 71.5. Structure of the Bootstrap BKI File

 The `open` command cannot be used until the tables it uses exist and have entries for the table that is to be opened. (These minimum tables are `pg_class`, `pg_attribute`, `pg_proc`, and `pg_type`.) To allow those tables themselves to be filled, `create` with the `bootstrap` option implicitly opens the created table for data insertion.

 Also, the `declare index` and `declare toast` commands cannot be used until the system catalogs they need have been created and filled in.

 Thus, the structure of the `postgres.bki` file has to be:

1. `create bootstrap` one of the critical tables

2. `insert` data describing at least the critical tables

3. `close`

4. Repeat for the other critical tables.

5. `create` (without `bootstrap`) a noncritical table

6. `open`

7. `insert` desired data

8. `close`

9. Repeat for the other noncritical tables.

10. Define indexes and toast tables.

11. `build indices`

 There are doubtless other, undocumented ordering dependencies.

---

|[Prev](bki-commands.html)|  [Up](bki.html)  | [Next](bki-example.html)|
|:------------------------|:----------------:|------------------------:|
|   71.4. BKI Commands    |[Home](index.html)|    71.6. BKI Example    |

 // \<![CDATA[ \<-- For SVG support if ('WebSocket' in window) { (function() { function refreshCSS() { var sheets = [].slice.call(document.getElementsByTagName("link")); var head = document.getElementsByTagName("head")[0]; for (var i = 0; i \< sheets.length; ++i) { var elem = sheets[i]; head.removeChild(elem); var rel = elem.rel; if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") { var url = elem.href.replace(/(&|\\?)\_cacheOverride=\\d+/, ''); elem.href = url + (url.indexOf('?') \>= 0 ? '&' : '?') + '\_cacheOverride=' + (new Date().valueOf()); } head.appendChild(elem); } } var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'; var address = protocol + window.location.host + window.location.pathname + '/ws'; var socket = new WebSocket(address); socket.onmessage = function(msg) { if (msg.data == 'reload') window.location.reload(); else if (msg.data == 'refreshcss') refreshCSS(); }; console.log('Live reload enabled.'); })(); } // ]]\>