20 #include "catalog/pg_type_d.h"
44 int numAttrs = tupleDesc->
natts;
49 for (
i = 0;
i < numAttrs;
i++)
78 memcmp((
char *) old_value, (
char *) new_value,
121 if (att->attlen == -1)
126 if (att->attstorage == TYPSTORAGE_PLAIN)
140 if (att->attstorage == TYPSTORAGE_PLAIN)
182 bool for_compression,
bool check_main)
185 int numAttrs = tupleDesc->
natts;
186 int biggest_attno = -1;
194 for (
i = 0;
i < numAttrs;
i++)
202 if (for_compression &&
205 if (check_main && att->attstorage != TYPSTORAGE_MAIN)
207 if (!check_main && att->attstorage != TYPSTORAGE_EXTENDED &&
208 att->attstorage != TYPSTORAGE_EXTERNAL)
218 return biggest_attno;
278 int numAttrs = tupleDesc->
natts;
287 for (
i = 0;
i < numAttrs;
i++)
303 for (
i = 0;
i < numAttrs;
i++)
322 int numAttrs = tupleDesc->
natts;
325 for (
i = 0;
i < numAttrs;
i++)
static Datum values[MAXATTR]
struct varlena * detoast_external_attr(struct varlena *attr)
struct varlena * detoast_attr(struct varlena *attr)
#define TOAST_POINTER_SIZE
void pfree(void *pointer)
FormData_pg_attribute * Form_pg_attribute
static Datum PointerGetDatum(const void *X)
static Pointer DatumGetPointer(Datum X)
struct varlena * tai_oldexternal
void toast_tuple_init(ToastTupleContext *ttc)
void toast_delete_external(Relation rel, const Datum *values, const bool *isnull, bool is_speculative)
void toast_tuple_try_compression(ToastTupleContext *ttc, int attribute)
void toast_tuple_externalize(ToastTupleContext *ttc, int attribute, int options)
void toast_tuple_cleanup(ToastTupleContext *ttc)
int toast_tuple_find_biggest_attribute(ToastTupleContext *ttc, bool for_compression, bool check_main)
#define TOAST_NEEDS_CHANGE
#define TOASTCOL_NEEDS_DELETE_OLD
#define TOASTCOL_INCOMPRESSIBLE
#define TOAST_NEEDS_DELETE_OLD
#define TOASTCOL_NEEDS_FREE
void toast_delete_datum(Relation rel, Datum value, bool is_speculative)
Datum toast_save_datum(Relation rel, Datum value, struct varlena *oldexternal, int options)
Datum toast_compress_datum(Datum value, char cmethod)
#define TupleDescAttr(tupdesc, i)
#define VARATT_IS_EXTERNAL_ONDISK(PTR)
#define VARATT_IS_COMPRESSED(PTR)
#define VARSIZE_EXTERNAL(PTR)
#define VARATT_IS_EXTERNAL(PTR)