215 elog(
ERROR,
"invalid sliceoffset: %d", sliceoffset);
224 slicelength = slicelimit = -1;
277 sliceoffset, slicelength);
291 struct varlena *tmp = preslice;
316 if (sliceoffset >= attrsize)
321 else if (slicelength < 0 || slicelimit > attrsize)
322 slicelength = attrsize - sliceoffset;
327 memcpy(
VARDATA(result), attrdata + sliceoffset, slicelength);
329 if (preslice != attr)
351 elog(
ERROR,
"toast_fetch_datum shouldn't be called for non-ondisk datums");
376 attrsize, 0, attrsize, result);
405 elog(
ERROR,
"toast_fetch_datum_slice shouldn't be called for non-ondisk datums");
419 if (sliceoffset >= attrsize)
431 slicelength = slicelength +
sizeof(
int32);
438 if (((sliceoffset + slicelength) > attrsize) || slicelength < 0)
439 slicelength = attrsize - sliceoffset;
448 if (slicelength == 0)
456 attrsize, sliceoffset, slicelength,
489 elog(
ERROR,
"invalid compression method id %d", cmid);
532 elog(
ERROR,
"invalid compression method id %d", cmid);
#define Assert(condition)
static struct varlena * toast_decompress_datum_slice(struct varlena *attr, int32 slicelength)
Size toast_datum_size(Datum value)
static struct varlena * toast_fetch_datum(struct varlena *attr)
struct varlena * detoast_external_attr(struct varlena *attr)
static struct varlena * toast_fetch_datum_slice(struct varlena *attr, int32 sliceoffset, int32 slicelength)
Size toast_raw_datum_size(Datum value)
struct varlena * detoast_attr(struct varlena *attr)
static struct varlena * toast_decompress_datum(struct varlena *attr)
struct varlena * detoast_attr_slice(struct varlena *attr, int32 sliceoffset, int32 slicelength)
#define VARATT_EXTERNAL_GET_POINTER(toast_pointer, attr)
ExpandedObjectHeader * DatumGetEOHP(Datum d)
void EOH_flatten_into(ExpandedObjectHeader *eohptr, void *result, Size allocated_size)
Size EOH_get_flat_size(ExpandedObjectHeader *eohptr)
static bool pg_add_s32_overflow(int32 a, int32 b, int32 *result)
void pfree(void *pointer)
int32 pglz_maximum_compressed_size(int32 rawsize, int32 total_compressed_size)
static Datum PointerGetDatum(const void *X)
static Pointer DatumGetPointer(Datum X)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
static void table_relation_fetch_toast_slice(Relation toastrel, Oid valueid, int32 attrsize, int32 sliceoffset, int32 slicelength, struct varlena *result)
struct varlena * lz4_decompress_datum(const struct varlena *value)
struct varlena * lz4_decompress_datum_slice(const struct varlena *value, int32 slicelength)
struct varlena * pglz_decompress_datum(const struct varlena *value)
struct varlena * pglz_decompress_datum_slice(const struct varlena *value, int32 slicelength)
@ TOAST_LZ4_COMPRESSION_ID
@ TOAST_PGLZ_COMPRESSION_ID
#define TOAST_COMPRESS_EXTSIZE(ptr)
#define TOAST_COMPRESS_METHOD(ptr)
#define VARATT_IS_EXTERNAL_ONDISK(PTR)
#define VARATT_IS_EXTERNAL_INDIRECT(PTR)
#define VARSIZE_SHORT(PTR)
#define VARATT_IS_EXTENDED(PTR)
#define VARATT_IS_EXTERNAL_EXPANDED(PTR)
#define VARATT_IS_SHORT(PTR)
#define SET_VARSIZE_COMPRESSED(PTR, len)
#define VARATT_EXTERNAL_GET_COMPRESS_METHOD(toast_pointer)
#define VARDATA_COMPRESSED_GET_EXTSIZE(PTR)
#define VARATT_EXTERNAL_IS_COMPRESSED(toast_pointer)
#define VARATT_IS_COMPRESSED(PTR)
#define SET_VARSIZE(PTR, len)
#define VARATT_EXTERNAL_GET_EXTSIZE(toast_pointer)
#define VARATT_IS_EXTERNAL(PTR)
#define VARDATA_SHORT(PTR)