PostgreSQL Source Code git master
|
#include "utils/snapshot.h"
Go to the source code of this file.
Data Structures | |
struct | LargeObjectDesc |
Macros | |
#define | IFS_RDLOCK (1 << 0) /* LO was opened for reading */ |
#define | IFS_WRLOCK (1 << 1) /* LO was opened for writing */ |
#define | LOBLKSIZE (BLCKSZ / 4) |
#define | MAX_LARGE_OBJECT_SIZE ((int64) INT_MAX * LOBLKSIZE) |
Typedefs | |
typedef struct LargeObjectDesc | LargeObjectDesc |
Functions | |
void | close_lo_relation (bool isCommit) |
Oid | inv_create (Oid lobjId) |
LargeObjectDesc * | inv_open (Oid lobjId, int flags, MemoryContext mcxt) |
void | inv_close (LargeObjectDesc *obj_desc) |
int | inv_drop (Oid lobjId) |
int64 | inv_seek (LargeObjectDesc *obj_desc, int64 offset, int whence) |
int64 | inv_tell (LargeObjectDesc *obj_desc) |
int | inv_read (LargeObjectDesc *obj_desc, char *buf, int nbytes) |
int | inv_write (LargeObjectDesc *obj_desc, const char *buf, int nbytes) |
void | inv_truncate (LargeObjectDesc *obj_desc, int64 len) |
Variables | |
PGDLLIMPORT bool | lo_compat_privileges |
#define IFS_RDLOCK (1 << 0) /* LO was opened for reading */ |
Definition at line 48 of file large_object.h.
#define IFS_WRLOCK (1 << 1) /* LO was opened for writing */ |
Definition at line 49 of file large_object.h.
#define LOBLKSIZE (BLCKSZ / 4) |
Definition at line 70 of file large_object.h.
Definition at line 76 of file large_object.h.
typedef struct LargeObjectDesc LargeObjectDesc |
void close_lo_relation | ( | bool | isCommit | ) |
Definition at line 97 of file inv_api.c.
References CurrentResourceOwner, index_close(), lo_heap_r, lo_index_r, NoLock, table_close(), and TopTransactionResourceOwner.
Referenced by AtEOXact_LargeObject().
void inv_close | ( | LargeObjectDesc * | obj_desc | ) |
Definition at line 299 of file inv_api.c.
References Assert, pfree(), and PointerIsValid.
Referenced by be_lo_export(), be_lo_from_bytea(), be_lo_put(), closeLOfd(), lo_get_fragment_internal(), and lo_import_internal().
Definition at line 173 of file inv_api.c.
References CommandCounterIncrement(), GetUserId(), InvokeObjectPostCreateHook, LargeObjectCreate(), and recordDependencyOnOwner().
Referenced by be_lo_creat(), be_lo_create(), be_lo_from_bytea(), and lo_import_internal().
int inv_drop | ( | Oid | lobjId | ) |
Definition at line 311 of file inv_api.c.
References ObjectAddress::classId, CommandCounterIncrement(), DROP_CASCADE, and performDeletion().
Referenced by be_lo_unlink().
LargeObjectDesc * inv_open | ( | Oid | lobjId, |
int | flags, | ||
MemoryContext | mcxt | ||
) |
Definition at line 215 of file inv_api.c.
References ACL_SELECT, ACL_UPDATE, ACLCHECK_OK, ereport, errcode(), errmsg(), ERROR, LargeObjectDesc::flags, GetActiveSnapshot(), GetUserId(), LargeObjectDesc::id, IFS_RDLOCK, IFS_WRLOCK, INV_READ, INV_WRITE, InvalidSubTransactionId, LargeObjectExistsWithSnapshot(), lo_compat_privileges, MemoryContextAlloc(), LargeObjectDesc::offset, pg_largeobject_aclcheck_snapshot(), LargeObjectDesc::snapshot, and LargeObjectDesc::subid.
Referenced by be_lo_export(), be_lo_from_bytea(), be_lo_open(), be_lo_put(), lo_get_fragment_internal(), and lo_import_internal().
int inv_read | ( | LargeObjectDesc * | obj_desc, |
char * | buf, | ||
int | nbytes | ||
) |
Definition at line 450 of file inv_api.c.
References Assert, BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, buf, data, elog, ereport, errcode(), errmsg(), ERROR, LargeObjectDesc::flags, ForwardScanDirection, getdatafield(), GETSTRUCT, HeapTupleHasNulls, LargeObjectDesc::id, IFS_RDLOCK, Int32GetDatum(), len, lo_heap_r, lo_index_r, LOBLKSIZE, MemSet, ObjectIdGetDatum(), LargeObjectDesc::offset, open_lo_relation(), pfree(), PointerIsValid, ScanKeyInit(), LargeObjectDesc::snapshot, systable_beginscan_ordered(), systable_endscan_ordered(), systable_getnext_ordered(), and VARDATA.
Referenced by be_lo_export(), lo_get_fragment_internal(), and lo_read().
int64 inv_seek | ( | LargeObjectDesc * | obj_desc, |
int64 | offset, | ||
int | whence | ||
) |
Definition at line 388 of file inv_api.c.
References Assert, ereport, errcode(), errmsg(), errmsg_internal(), ERROR, INT64_FORMAT, inv_getsize(), MAX_LARGE_OBJECT_SIZE, LargeObjectDesc::offset, and PointerIsValid.
Referenced by be_lo_lseek(), be_lo_lseek64(), be_lo_put(), and lo_get_fragment_internal().
int64 inv_tell | ( | LargeObjectDesc * | obj_desc | ) |
Definition at line 437 of file inv_api.c.
References Assert, LargeObjectDesc::offset, and PointerIsValid.
Referenced by be_lo_tell(), and be_lo_tell64().
void inv_truncate | ( | LargeObjectDesc * | obj_desc, |
int64 | len | ||
) |
Definition at line 740 of file inv_api.c.
References Assert, BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, CatalogCloseIndexes(), CatalogOpenIndexes(), CatalogTupleDelete(), CatalogTupleInsertWithInfo(), CatalogTupleUpdateWithInfo(), CommandCounterIncrement(), data, elog, ereport, errcode(), errmsg(), errmsg_internal(), ERROR, LargeObjectDesc::flags, ForwardScanDirection, getdatafield(), GETSTRUCT, heap_form_tuple(), heap_freetuple(), heap_modify_tuple(), HeapTupleHasNulls, LargeObjectDesc::id, IFS_WRLOCK, Int32GetDatum(), INT64_FORMAT, len, lo_heap_r, lo_index_r, LOBLKSIZE, MAX_LARGE_OBJECT_SIZE, MemSet, ObjectIdGetDatum(), open_lo_relation(), pfree(), PointerGetDatum(), PointerIsValid, RelationData::rd_att, RelationGetDescr, ScanKeyInit(), SET_VARSIZE, LargeObjectDesc::snapshot, systable_beginscan_ordered(), systable_endscan_ordered(), systable_getnext_ordered(), HeapTupleData::t_self, values, VARDATA, and VARHDRSZ.
Referenced by lo_truncate_internal().
int inv_write | ( | LargeObjectDesc * | obj_desc, |
const char * | buf, | ||
int | nbytes | ||
) |
Definition at line 543 of file inv_api.c.
References Assert, BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, buf, CatalogCloseIndexes(), CatalogOpenIndexes(), CatalogTupleInsertWithInfo(), CatalogTupleUpdateWithInfo(), CommandCounterIncrement(), data, elog, ereport, errcode(), errmsg(), ERROR, LargeObjectDesc::flags, ForwardScanDirection, getdatafield(), GETSTRUCT, heap_form_tuple(), heap_freetuple(), heap_modify_tuple(), HeapTupleHasNulls, LargeObjectDesc::id, IFS_WRLOCK, Int32GetDatum(), len, lo_heap_r, lo_index_r, LOBLKSIZE, MAX_LARGE_OBJECT_SIZE, MemSet, ObjectIdGetDatum(), LargeObjectDesc::offset, open_lo_relation(), pfree(), PointerGetDatum(), PointerIsValid, RelationData::rd_att, RelationGetDescr, ScanKeyInit(), SET_VARSIZE, LargeObjectDesc::snapshot, systable_beginscan_ordered(), systable_endscan_ordered(), systable_getnext_ordered(), HeapTupleData::t_self, values, VARDATA, and VARHDRSZ.
Referenced by be_lo_from_bytea(), be_lo_put(), lo_import_internal(), and lo_write().
|
extern |
Definition at line 56 of file inv_api.c.
Referenced by be_lo_unlink(), check_object_ownership(), has_lo_priv_byid(), and inv_open().