1 .\" Copyright (c) 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)recno.3 8.5 (Berkeley) 8/18/94
29 .\" $FreeBSD: src/lib/libc/db/man/recno.3,v 1.4.2.2 2001/12/14 18:33:49 ru Exp $
30 .\" $DragonFly: src/lib/libc/db/man/recno.3,v 1.4 2006/05/26 19:39:36 swildner Exp $
37 .Nd "record number database access method"
44 is the library interface to database files.
45 One of the supported file formats is record number files.
46 The general description of the database access methods is in
48 this manual page describes only the
52 The record number data structure is either variable or fixed-length
53 records stored in a flat-file format, accessed by the logical record
55 The existence of record number five implies the existence of records
56 one through four, and the deletion of record number one causes
57 record number five to be renumbered to record number four, as well
58 as the cursor, if positioned after record number one, to shift down
63 access method specific data structure provided to
67 include file as follows:
80 The elements of this structure are defined as follows:
81 .Bl -tag -width indent
83 The flag value is specified by
85 any of the following values:
86 .Bl -tag -width indent
88 The records are fixed-length, not byte delimited.
91 specifies the length of the record, and the structure element
93 is used as the pad character.
94 Any records, inserted into the database, that are less than
96 bytes long are automatically padded.
98 In the interface specified by
100 the sequential record retrieval fills in both the caller's key and
104 flag is specified, the
106 routines are not required to fill in the key structure.
107 This permits applications to retrieve records at the end of files without
108 reading all of the intervening records.
110 This flag requires that a snapshot of the file be taken when
112 is called, instead of permitting any unmodified records to be read from
116 A suggested maximum size, in bytes, of the memory cache.
119 advisory, and the access method will allocate more memory rather than fail.
122 is 0 (no size is specified) a default cache is used.
126 access method stores the in-memory copies of its records
128 This value is the size (in bytes) of the pages used for nodes in that tree.
131 is 0 (no page size is specified) a page size is chosen based on the
132 underlying file system I/O block size.
135 for more information.
137 The byte order for integers in the stored database metadata.
138 The number should represent the order as an integer; for example,
139 big endian order would be the number 4,321.
142 is 0 (no order is specified) the current host order is used.
144 The length of a fixed-length record.
146 The delimiting byte to be used to mark the end of a record for
147 variable-length records, and the pad character for fixed-length
149 If no value is specified, newlines
151 are used to mark the end
152 of variable-length records and fixed-length records are padded with
157 access method stores the in-memory copies of its records
162 .No non\- Ns Dv NULL ,
163 it specifies the name of the btree file,
164 as if specified as the file name for a
169 The data part of the key/data pair used by the
172 is the same as other access methods.
173 The key is different.
176 field of the key should be a pointer to a memory location of type
181 This type is normally the largest unsigned integral type available to
185 field of the key should be the size of that type.
187 Because there can be no meta-data associated with the underlying
189 access method files, any changes made to the default values
190 (e.g. fixed record length or byte separator value) must be explicitly
191 specified each time the file is opened.
193 In the interface specified by
197 interface to create a new record will cause the creation of multiple,
198 empty records if the record number is more than one greater than the
199 largest record currently in the database.
203 access method routines may fail and set
205 for any of the errors specified for the library routine
210 An attempt was made to add a record to a fixed-length database that
211 was too large to fit.
219 .%T "Document Processing in a Relational Database System"
220 .%A Michael Stonebraker
225 .%R "Memorandum No. UCB/ERL M82/32"
229 Only big and little endian byte order is supported.