|
48 | 48 | callbacks and their behavior is defined in the
|
49 | 49 | <structname>TableAmRoutine</structname> structure (with comments inside the
|
50 | 50 | struct defining the requirements for callbacks). Most callbacks have
|
51 |
| - wrapper functions, which are documented for the point of view of a user, |
52 |
| - rather than an implementor, of the table access method. For details, |
| 51 | + wrapper functions, which are documented from the point of view of a user |
| 52 | + (rather than an implementor) of the table access method. For details, |
53 | 53 | please refer to the <ulink url="https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/access/tableam.h;hb=HEAD">
|
54 | 54 | <filename>src/include/access/tableam.h</filename></ulink> file.
|
55 | 55 | </para>
|
56 | 56 |
|
57 | 57 | <para>
|
58 |
| - To implement a access method, an implementor will typically need to |
59 |
| - implement a AM specific type of tuple table slot (see |
| 58 | + To implement an access method, an implementor will typically need to |
| 59 | + implement an AM-specific type of tuple table slot (see |
60 | 60 | <ulink url="https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/executor/tuptable.h;hb=HEAD">
|
61 |
| - <filename>src/include/executor/tuptable.h</filename></ulink>) which allows |
| 61 | + <filename>src/include/executor/tuptable.h</filename></ulink>), which allows |
62 | 62 | code outside the access method to hold references to tuples of the AM, and
|
63 | 63 | to access the columns of the tuple.
|
64 | 64 | </para>
|
65 | 65 |
|
66 | 66 | <para>
|
67 |
| - Currently the the way an AM actually stores data is fairly |
68 |
| - unconstrained. It is e.g. possible to use postgres' shared buffer cache, |
69 |
| - but not required. In case shared buffers are used, it likely makes to |
70 |
| - postgres' standard page layout described in <xref |
71 |
| - linkend="storage-page-layout"/>. |
| 67 | + Currently, the way an AM actually stores data is fairly unconstrained. For |
| 68 | + example, it's possible, but not required, to use postgres' shared buffer |
| 69 | + cache. In case it is used, it likely makes sense to use |
| 70 | + <productname>PostgreSQL</productname>'s standard page layout as described in |
| 71 | + <xref linkend="storage-page-layout"/>. |
72 | 72 | </para>
|
73 | 73 |
|
74 | 74 | <para>
|
75 | 75 | One fairly large constraint of the table access method API is that,
|
76 | 76 | currently, if the AM wants to support modifications and/or indexes, it is
|
77 |
| - necessary that each tuple has a tuple identifier (<acronym>TID</acronym>) |
| 77 | + necessary for each tuple to have a tuple identifier (<acronym>TID</acronym>) |
78 | 78 | consisting of a block number and an item number (see also <xref
|
79 | 79 | linkend="storage-page-layout"/>). It is not strictly necessary that the
|
80 | 80 | sub-parts of <acronym>TIDs</acronym> have the same meaning they e.g. have
|
|
83 | 83 | </para>
|
84 | 84 |
|
85 | 85 | <para>
|
86 |
| - For crash safety an AM can use postgres' <link |
87 |
| - linkend="wal"><acronym>WAL</acronym></link>, or a custom approach can be |
88 |
| - implemented. If <acronym>WAL</acronym> is chosen, either <link |
89 |
| - linkend="generic-wal">Generic WAL Records</link> can be used — which |
90 |
| - implies higher WAL volume but is easy, or a new type of |
91 |
| - <acronym>WAL</acronym> records can be implemented — but that |
92 |
| - currently requires modifications of core code (namely modifying |
| 86 | + For crash safety, an AM can use postgres' <link |
| 87 | + linkend="wal"><acronym>WAL</acronym></link>, or a custom implementation. |
| 88 | + If <acronym>WAL</acronym> is chosen, either <link |
| 89 | + linkend="generic-wal">Generic WAL Records</link> can be used, |
| 90 | + or a new type of <acronym>WAL</acronym> records can be implemented. |
| 91 | + Generic WAL Records are easy, but imply higher WAL volume. |
| 92 | + Implementation of a new type of WAL record |
| 93 | + currently requires modifications to core code (specifically, |
93 | 94 | <filename>src/include/access/rmgrlist.h</filename>).
|
94 | 95 | </para>
|
95 | 96 |
|
|
103 | 104 | <para>
|
104 | 105 | Any developer of a new <literal>table access method</literal> can refer to
|
105 | 106 | the existing <literal>heap</literal> implementation present in
|
106 |
| - <filename>src/backend/heap/heapam_handler.c</filename> for more details of |
107 |
| - how it is implemented. |
| 107 | + <filename>src/backend/heap/heapam_handler.c</filename> for details of |
| 108 | + its implementation. |
108 | 109 | </para>
|
109 | 110 |
|
110 | 111 | </chapter>
|
0 commit comments