1 /*-------------------------------------------------------------------------
4 * POSTGRES "position" definitions.
7 * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/storage/pos.h
12 *-------------------------------------------------------------------------
19 * a 'position' used to be <pagenumber, offset> in postgres. this has
20 * been changed to just <offset> as the notion of having multiple pages
21 * within a block has been removed.
23 * the 'offset' abstraction is somewhat confusing. it is NOT a byte
24 * offset within the page; instead, it is an offset into the line
25 * pointer array contained on every page that store (heap or index)
28 typedef bits16 PositionIdData;
29 typedef PositionIdData *PositionId;
38 * True iff the position identifier is valid.
40 #define PositionIdIsValid(positionId) \
41 PointerIsValid(positionId)
44 * PositionIdSetInvalid
45 * Make an invalid position.
47 #define PositionIdSetInvalid(positionId) \
48 *(positionId) = (bits16) 0
52 * Sets a position identifier to the specified value.
54 #define PositionIdSet(positionId, offsetNumber) \
55 *(positionId) = (offsetNumber)
58 * PositionIdGetOffsetNumber
59 * Retrieve the offset number from a position identifier.
61 #define PositionIdGetOffsetNumber(positionId) \
62 ((OffsetNumber) *(positionId))