PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/detoast.h"
#include "access/genam.h"
#include "access/heapam.h"
#include "access/heaptoast.h"
#include "access/table.h"
#include "access/toast_internals.h"
#include "access/xact.h"
#include "catalog/catalog.h"
#include "miscadmin.h"
#include "utils/fmgroids.h"
#include "utils/rel.h"
#include "utils/snapmgr.h"
Go to the source code of this file.
Functions | |
static bool | toastrel_valueid_exists (Relation toastrel, Oid valueid) |
static bool | toastid_valueid_exists (Oid toastrelid, Oid valueid) |
Datum | toast_compress_datum (Datum value, char cmethod) |
Datum | toast_save_datum (Relation rel, Datum value, struct varlena *oldexternal, int options) |
void | toast_delete_datum (Relation rel, Datum value, bool is_speculative) |
Oid | toast_get_valid_index (Oid toastoid, LOCKMODE lock) |
int | toast_open_indexes (Relation toastrel, LOCKMODE lock, Relation **toastidxs, int *num_indexes) |
void | toast_close_indexes (Relation *toastidxs, int num_indexes, LOCKMODE lock) |
void | init_toast_snapshot (Snapshot toast_snapshot) |
void init_toast_snapshot | ( | Snapshot | toast_snapshot | ) |
Definition at line 641 of file toast_internals.c.
References Assert, elog, ERROR, GetOldestSnapshot(), HaveRegisteredOrActiveSnapshot(), InitToastSnapshot, SnapshotData::lsn, and SnapshotData::whenTaken.
Referenced by check_toasted_attribute(), heap_fetch_toast_slice(), and toast_delete_datum().
Definition at line 623 of file toast_internals.c.
References i, index_close(), and pfree().
Referenced by heap_fetch_toast_slice(), toast_delete_datum(), toast_get_valid_index(), toast_save_datum(), toastrel_valueid_exists(), and verify_heapam().
Definition at line 46 of file toast_internals.c.
References Assert, CompressionMethodIsValid, DatumGetPointer(), default_toast_compression, elog, ERROR, lz4_compress_datum(), pfree(), pglz_compress_datum(), PointerGetDatum(), TOAST_COMPRESS_SET_SIZE_AND_COMPRESS_METHOD, TOAST_INVALID_COMPRESSION_ID, TOAST_LZ4_COMPRESSION, TOAST_LZ4_COMPRESSION_ID, TOAST_PGLZ_COMPRESSION, TOAST_PGLZ_COMPRESSION_ID, value, VARATT_IS_COMPRESSED, VARATT_IS_EXTERNAL, VARSIZE, and VARSIZE_ANY_EXHDR.
Referenced by brin_form_tuple(), index_form_tuple_context(), and toast_tuple_try_compression().
Definition at line 385 of file toast_internals.c.
References BTEqualStrategyNumber, DatumGetPointer(), ForwardScanDirection, heap_abort_speculative(), init_toast_snapshot(), NoLock, ObjectIdGetDatum(), RowExclusiveLock, ScanKeyInit(), simple_heap_delete(), systable_beginscan_ordered(), systable_endscan_ordered(), systable_getnext_ordered(), HeapTupleData::t_self, table_close(), table_open(), toast_close_indexes(), toast_open_indexes(), varatt_external::va_toastrelid, varatt_external::va_valueid, value, VARATT_EXTERNAL_GET_POINTER, and VARATT_IS_EXTERNAL_ONDISK.
Referenced by toast_delete_external(), and toast_tuple_cleanup().
Definition at line 530 of file toast_internals.c.
References NoLock, RelationGetRelid, table_close(), table_open(), toast_close_indexes(), and toast_open_indexes().
Referenced by finish_heap_swap(), and swap_relation_files().
int toast_open_indexes | ( | Relation | toastrel, |
LOCKMODE | lock, | ||
Relation ** | toastidxs, | ||
int * | num_indexes | ||
) |
Definition at line 564 of file toast_internals.c.
References Assert, elog, ERROR, i, index_open(), lfirst_oid, list_free(), list_length(), NIL, palloc(), RelationData::rd_index, RelationGetIndexList(), RelationGetRelid, and res.
Referenced by heap_fetch_toast_slice(), toast_delete_datum(), toast_get_valid_index(), toast_save_datum(), toastrel_valueid_exists(), and verify_heapam().
Definition at line 119 of file toast_internals.c.
References Assert, CHECK_FOR_INTERRUPTS, data, DatumGetPointer(), GetCurrentCommandId(), GetNewOidWithIndex(), heap_form_tuple(), heap_freetuple(), heap_insert(), i, index_insert(), Int32GetDatum(), InvalidOid, Min, NoLock, ObjectIdGetDatum(), OidIsValid, palloc(), PointerGetDatum(), RelationData::rd_att, RelationData::rd_index, RelationData::rd_rel, RelationData::rd_toastoid, RelationGetRelid, RowExclusiveLock, SET_VARSIZE, SET_VARTAG_EXTERNAL, HeapTupleData::t_self, table_close(), table_open(), toast_close_indexes(), TOAST_MAX_CHUNK_SIZE, toast_open_indexes(), TOAST_POINTER_SIZE, toastid_valueid_exists(), toastrel_valueid_exists(), UNIQUE_CHECK_NO, UNIQUE_CHECK_YES, varatt_external::va_extinfo, varatt_external::va_rawsize, varatt_external::va_toastrelid, varatt_external::va_valueid, value, VARATT_EXTERNAL_GET_POINTER, VARATT_EXTERNAL_IS_COMPRESSED, VARATT_EXTERNAL_SET_SIZE_AND_COMPRESS_METHOD, VARATT_IS_COMPRESSED, VARATT_IS_EXTERNAL, VARATT_IS_EXTERNAL_ONDISK, VARATT_IS_SHORT, VARDATA, VARDATA_COMPRESSED_GET_COMPRESS_METHOD, VARDATA_COMPRESSED_GET_EXTSIZE, VARDATA_EXTERNAL, VARDATA_SHORT, VARHDRSZ, VARHDRSZ_SHORT, VARSIZE, VARSIZE_SHORT, and VARTAG_ONDISK.
Referenced by toast_tuple_externalize().
Definition at line 509 of file toast_internals.c.
References AccessShareLock, table_close(), table_open(), and toastrel_valueid_exists().
Referenced by toast_save_datum().
Definition at line 461 of file toast_internals.c.
References BTEqualStrategyNumber, ObjectIdGetDatum(), RelationGetRelid, RowExclusiveLock, ScanKeyInit(), SnapshotAny, systable_beginscan(), systable_endscan(), systable_getnext(), toast_close_indexes(), and toast_open_indexes().
Referenced by toast_save_datum(), and toastid_valueid_exists().