12 #ifndef TOAST_INTERNALS_H
13 #define TOAST_INTERNALS_H
34 #define TOAST_COMPRESS_EXTSIZE(ptr) \
35 (((toast_compress_header *) (ptr))->tcinfo & VARLENA_EXTSIZE_MASK)
36 #define TOAST_COMPRESS_METHOD(ptr) \
37 (((toast_compress_header *) (ptr))->tcinfo >> VARLENA_EXTSIZE_BITS)
39 #define TOAST_COMPRESS_SET_SIZE_AND_COMPRESS_METHOD(ptr, len, cm_method) \
41 Assert((len) > 0 && (len) <= VARLENA_EXTSIZE_MASK); \
42 Assert((cm_method) == TOAST_PGLZ_COMPRESSION_ID || \
43 (cm_method) == TOAST_LZ4_COMPRESSION_ID); \
44 ((toast_compress_header *) (ptr))->tcinfo = \
45 (len) | ((uint32) (cm_method) << VARLENA_EXTSIZE_BITS); \
void toast_close_indexes(Relation *toastidxs, int num_indexes, LOCKMODE lock)
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)
struct toast_compress_header toast_compress_header
void init_toast_snapshot(Snapshot toast_snapshot)
Oid toast_get_valid_index(Oid toastoid, LOCKMODE lock)
int toast_open_indexes(Relation toastrel, LOCKMODE lock, Relation **toastidxs, int *num_indexes)