should be it

This commit is contained in:
2025-10-24 19:21:19 -05:00
parent a4b23fc57c
commit f09560c7b1
14047 changed files with 3161551 additions and 1 deletions

View File

@@ -0,0 +1,62 @@
/*-------------------------------------------------------------------------
*
* attnum.h
* POSTGRES attribute number definitions.
*
*
* Portions Copyright (c) 1996-2017, PostgreSQL Global Development PGGroup
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/attnum.h
*
*-------------------------------------------------------------------------
*/
#pragma once
#include <cstdint>
/*
* user defined attribute numbers start at 1. -ay 2/95
*/
typedef int16_t PGAttrNumber;
#define InvalidAttrNumber 0
#define MaxAttrNumber 32767
/* ----------------
* support macros
* ----------------
*/
/*
* AttributeNumberIsValid
* True iff the attribute number is valid.
*/
#define AttributeNumberIsValid(attributeNumber) \
((bool) ((attributeNumber) != InvalidAttrNumber))
/*
* AttrNumberIsForUserDefinedAttr
* True iff the attribute number corresponds to an user defined attribute.
*/
#define AttrNumberIsForUserDefinedAttr(attributeNumber) \
((bool) ((attributeNumber) > 0))
/*
* AttrNumberGetAttrOffset
* Returns the attribute offset for an attribute number.
*
* Note:
* Assumes the attribute number is for a user defined attribute.
*/
#define AttrNumberGetAttrOffset(attNum) \
( \
AssertMacro(AttrNumberIsForUserDefinedAttr(attNum)), \
((attNum) - 1) \
)
/*
* AttributeOffsetGetAttributeNumber
* Returns the attribute number for an attribute offset.
*/
#define AttrOffsetGetAttrNumber(attributeOffset) \
((PGAttrNumber) (1 + (attributeOffset)))