PostgreSQL Source Code  git master
tupmacs.h File Reference
#include "catalog/pg_type_d.h"
Include dependency graph for tupmacs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define att_isnull(ATT, BITS)   (!((BITS)[(ATT) >> 3] & (1 << ((ATT) & 0x07))))
 
#define fetchatt(A, T)   fetch_att(T, (A)->attbyval, (A)->attlen)
 
#define fetch_att(T, attbyval, attlen)
 
#define att_align_datum(cur_offset, attalign, attlen, attdatum)
 
#define att_align_pointer(cur_offset, attalign, attlen, attptr)
 
#define att_align_nominal(cur_offset, attalign)
 
#define att_addlength_datum(cur_offset, attlen, attdatum)   att_addlength_pointer(cur_offset, attlen, DatumGetPointer(attdatum))
 
#define att_addlength_pointer(cur_offset, attlen, attptr)
 
#define store_att_byval(T, newdatum, attlen)
 

Macro Definition Documentation

◆ att_addlength_datum

◆ att_addlength_pointer

#define att_addlength_pointer (   cur_offset,
  attlen,
  attptr 
)

◆ att_align_datum

#define att_align_datum (   cur_offset,
  attalign,
  attlen,
  attdatum 
)
Value:
( \
((attlen) == -1 && VARATT_IS_SHORT(DatumGetPointer(attdatum))) ? \
(uintptr_t) (cur_offset) : \
att_align_nominal(cur_offset, attalign) \
)
#define VARATT_IS_SHORT(PTR)
Definition: postgres.h:339
char attalign
Definition: pg_attribute.h:126
int16 attlen
Definition: pg_attribute.h:68
#define DatumGetPointer(X)
Definition: postgres.h:593

Definition at line 105 of file tupmacs.h.

Referenced by datum_compute_size(), expand_tuple(), and heap_compute_data_size().

◆ att_align_nominal

◆ att_align_pointer

#define att_align_pointer (   cur_offset,
  attalign,
  attlen,
  attptr 
)
Value:
( \
((attlen) == -1 && VARATT_NOT_PAD_BYTE(attptr)) ? \
(uintptr_t) (cur_offset) : \
att_align_nominal(cur_offset, attalign) \
)
#define att_align_nominal(cur_offset, attalign)
Definition: tupmacs.h:148
char attalign
Definition: pg_attribute.h:126
int16 attlen
Definition: pg_attribute.h:68
#define VARATT_NOT_PAD_BYTE(PTR)
Definition: postgres.h:258

Definition at line 126 of file tupmacs.h.

Referenced by brin_deconstruct_tuple(), check_tuple_attribute(), heap_deform_tuple(), index_deform_tuple_internal(), multirange_get_bounds(), nocache_index_getattr(), nocachegetattr(), range_deserialize(), slot_deform_heap_tuple(), and tuple_data_split_internal().

◆ att_isnull

◆ fetch_att

#define fetch_att (   T,
  attbyval,
  attlen 
)
Value:
( \
(attbyval) ? \
( \
(attlen) == (int) sizeof(int32) ? \
Int32GetDatum(*((int32 *)(T))) \
: \
( \
(attlen) == (int) sizeof(int16) ? \
Int16GetDatum(*((int16 *)(T))) \
: \
( \
AssertMacro((attlen) == 1), \
CharGetDatum(*((char *)(T))) \
) \
) \
) \
: \
PointerGetDatum((char *) (T)) \
)
signed short int16
Definition: c.h:428
#define Int16GetDatum(X)
Definition: postgres.h:495
#define AssertMacro(condition)
Definition: c.h:805
signed int int32
Definition: c.h:429
bool attbyval
Definition: pg_attribute.h:112
int16 attlen
Definition: pg_attribute.h:68
static const uint32 T[65]
Definition: md5.c:119
#define CharGetDatum(X)
Definition: postgres.h:460

Definition at line 75 of file tupmacs.h.

Referenced by array_iter_next(), array_iterate(), array_replace_internal(), array_to_text_internal(), ArrayCast(), deconstruct_array(), ExecEvalHashedScalarArrayOp(), ExecEvalScalarArrayOp(), multirange_get_bounds(), PLyList_FromArray_recurse(), range_deserialize(), statext_mcv_deserialize(), width_bucket_array_fixed(), and width_bucket_array_variable().

◆ fetchatt

◆ store_att_byval

#define store_att_byval (   T,
  newdatum,
  attlen 
)
Value:
do { \
switch (attlen) \
{ \
case sizeof(char): \
*(char *) (T) = DatumGetChar(newdatum); \
break; \
case sizeof(int16): \
*(int16 *) (T) = DatumGetInt16(newdatum); \
break; \
case sizeof(int32): \
*(int32 *) (T) = DatumGetInt32(newdatum); \
break; \
default: \
elog(ERROR, "unsupported byval length: %d", \
(int) (attlen)); \
break; \
} \
} while (0)
signed short int16
Definition: c.h:428
#define DatumGetInt32(X)
Definition: postgres.h:516
signed int int32
Definition: c.h:429
#define ERROR
Definition: elog.h:46
#define DatumGetInt16(X)
Definition: postgres.h:488
int16 attlen
Definition: pg_attribute.h:68
#define DatumGetChar(X)
Definition: postgres.h:453
static const uint32 T[65]
Definition: md5.c:119

Definition at line 226 of file tupmacs.h.

Referenced by ArrayCastAndSet(), datum_write(), fill_val(), range_serialize(), and statext_mcv_serialize().