PostgreSQL Source Code
git master
|
#include "access/tupdesc.h"
#include "access/xlog.h"
#include "catalog/catalog.h"
#include "catalog/pg_class.h"
#include "catalog/pg_index.h"
#include "catalog/pg_publication.h"
#include "nodes/bitmapset.h"
#include "partitioning/partdefs.h"
#include "rewrite/prs2lock.h"
#include "storage/block.h"
#include "storage/relfilelocator.h"
#include "storage/smgr.h"
#include "utils/relcache.h"
#include "utils/reltrigger.h"
Go to the source code of this file.
Data Structures | |
struct | LockRelId |
struct | LockInfoData |
struct | RelationData |
struct | ForeignKeyCacheInfo |
struct | AutoVacOpts |
struct | StdRdOptions |
struct | ViewOptions |
Macros | |
#define | HEAP_MIN_FILLFACTOR 10 |
#define | HEAP_DEFAULT_FILLFACTOR 100 |
#define | RelationGetToastTupleTarget(relation, defaulttarg) |
#define | RelationGetFillFactor(relation, defaultff) |
#define | RelationGetTargetPageUsage(relation, defaultff) (BLCKSZ * RelationGetFillFactor(relation, defaultff) / 100) |
#define | RelationGetTargetPageFreeSpace(relation, defaultff) (BLCKSZ * (100 - RelationGetFillFactor(relation, defaultff)) / 100) |
#define | RelationIsUsedAsCatalogTable(relation) |
#define | RelationGetParallelWorkers(relation, defaultpw) |
#define | RelationIsSecurityView(relation) |
#define | RelationHasSecurityInvoker(relation) |
#define | RelationHasCheckOption(relation) |
#define | RelationHasLocalCheckOption(relation) |
#define | RelationHasCascadedCheckOption(relation) |
#define | RelationIsValid(relation) PointerIsValid(relation) |
#define | InvalidRelation ((Relation) NULL) |
#define | RelationHasReferenceCountZero(relation) ((bool)((relation)->rd_refcnt == 0)) |
#define | RelationGetForm(relation) ((relation)->rd_rel) |
#define | RelationGetRelid(relation) ((relation)->rd_id) |
#define | RelationGetNumberOfAttributes(relation) ((relation)->rd_rel->relnatts) |
#define | IndexRelationGetNumberOfAttributes(relation) ((relation)->rd_index->indnatts) |
#define | IndexRelationGetNumberOfKeyAttributes(relation) ((relation)->rd_index->indnkeyatts) |
#define | RelationGetDescr(relation) ((relation)->rd_att) |
#define | RelationGetRelationName(relation) (NameStr((relation)->rd_rel->relname)) |
#define | RelationGetNamespace(relation) ((relation)->rd_rel->relnamespace) |
#define | RelationIsMapped(relation) |
#define | RelationGetTargetBlock(relation) ( (relation)->rd_smgr != NULL ? (relation)->rd_smgr->smgr_targblock : InvalidBlockNumber ) |
#define | RelationSetTargetBlock(relation, targblock) |
#define | RelationIsPermanent(relation) ((relation)->rd_rel->relpersistence == RELPERSISTENCE_PERMANENT) |
#define | RelationNeedsWAL(relation) |
#define | RelationUsesLocalBuffers(relation) ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP) |
#define | RELATION_IS_LOCAL(relation) |
#define | RELATION_IS_OTHER_TEMP(relation) |
#define | RelationIsScannable(relation) ((relation)->rd_rel->relispopulated) |
#define | RelationIsPopulated(relation) ((relation)->rd_rel->relispopulated) |
#define | RelationIsAccessibleInLogicalDecoding(relation) |
#define | RelationIsLogicallyLogged(relation) |
Typedefs | |
typedef struct LockRelId | LockRelId |
typedef struct LockInfoData | LockInfoData |
typedef LockInfoData * | LockInfo |
typedef struct RelationData | RelationData |
typedef struct ForeignKeyCacheInfo | ForeignKeyCacheInfo |
typedef struct AutoVacOpts | AutoVacOpts |
typedef enum StdRdOptIndexCleanup | StdRdOptIndexCleanup |
typedef struct StdRdOptions | StdRdOptions |
typedef enum ViewOptCheckOption | ViewOptCheckOption |
typedef struct ViewOptions | ViewOptions |
Functions | |
static SMgrRelation | RelationGetSmgr (Relation rel) |
static void | RelationCloseSmgr (Relation relation) |
void | RelationIncrementReferenceCount (Relation rel) |
void | RelationDecrementReferenceCount (Relation rel) |
#define IndexRelationGetNumberOfAttributes | ( | relation | ) | ((relation)->rd_index->indnatts) |
#define IndexRelationGetNumberOfKeyAttributes | ( | relation | ) | ((relation)->rd_index->indnkeyatts) |
#define RELATION_IS_LOCAL | ( | relation | ) |
#define RELATION_IS_OTHER_TEMP | ( | relation | ) |
#define RelationGetFillFactor | ( | relation, | |
defaultff | |||
) |
#define RelationGetNamespace | ( | relation | ) | ((relation)->rd_rel->relnamespace) |
#define RelationGetNumberOfAttributes | ( | relation | ) | ((relation)->rd_rel->relnatts) |
#define RelationGetParallelWorkers | ( | relation, | |
defaultpw | |||
) |
#define RelationGetTargetBlock | ( | relation | ) | ( (relation)->rd_smgr != NULL ? (relation)->rd_smgr->smgr_targblock : InvalidBlockNumber ) |
#define RelationGetTargetPageFreeSpace | ( | relation, | |
defaultff | |||
) | (BLCKSZ * (100 - RelationGetFillFactor(relation, defaultff)) / 100) |
#define RelationGetTargetPageUsage | ( | relation, | |
defaultff | |||
) | (BLCKSZ * RelationGetFillFactor(relation, defaultff) / 100) |
#define RelationGetToastTupleTarget | ( | relation, | |
defaulttarg | |||
) |
#define RelationHasCascadedCheckOption | ( | relation | ) |
#define RelationHasCheckOption | ( | relation | ) |
#define RelationHasLocalCheckOption | ( | relation | ) |
#define RelationHasReferenceCountZero | ( | relation | ) | ((bool)((relation)->rd_refcnt == 0)) |
#define RelationHasSecurityInvoker | ( | relation | ) |
#define RelationIsAccessibleInLogicalDecoding | ( | relation | ) |
#define RelationIsLogicallyLogged | ( | relation | ) |
#define RelationIsMapped | ( | relation | ) |
#define RelationIsPermanent | ( | relation | ) | ((relation)->rd_rel->relpersistence == RELPERSISTENCE_PERMANENT) |
#define RelationIsPopulated | ( | relation | ) | ((relation)->rd_rel->relispopulated) |
#define RelationIsScannable | ( | relation | ) | ((relation)->rd_rel->relispopulated) |
#define RelationIsSecurityView | ( | relation | ) |
#define RelationIsUsedAsCatalogTable | ( | relation | ) |
#define RelationIsValid | ( | relation | ) | PointerIsValid(relation) |
#define RelationNeedsWAL | ( | relation | ) |
#define RelationSetTargetBlock | ( | relation, | |
targblock | |||
) |
#define RelationUsesLocalBuffers | ( | relation | ) | ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP) |
typedef struct AutoVacOpts AutoVacOpts |
typedef struct ForeignKeyCacheInfo ForeignKeyCacheInfo |
typedef LockInfoData* LockInfo |
typedef struct LockInfoData LockInfoData |
typedef struct RelationData RelationData |
typedef enum StdRdOptIndexCleanup StdRdOptIndexCleanup |
typedef struct StdRdOptions StdRdOptions |
typedef enum ViewOptCheckOption ViewOptCheckOption |
typedef struct ViewOptions ViewOptions |
enum StdRdOptIndexCleanup |
enum ViewOptCheckOption |
|
inlinestatic |
Definition at line 582 of file rel.h.
References RelationData::rd_smgr, smgrclose(), and smgrunpin().
Referenced by RelationCacheInvalidate(), RelationClearRelation(), RelationDestroyRelation(), RelationDropStorage(), RelationInvalidateRelation(), and RelationReloadIndexInfo().
void RelationDecrementReferenceCount | ( | Relation | rel | ) |
Definition at line 2172 of file relcache.c.
References Assert, CurrentResourceOwner, IsBootstrapProcessingMode, RelationData::rd_refcnt, and ResourceOwnerForgetRelationRef().
Referenced by DestroyPartitionDirectory(), heap_endscan(), index_endscan(), RelationCacheInitializePhase3(), RelationClose(), and RelationFlushRelation().
|
inlinestatic |
Definition at line 567 of file rel.h.
References RelationData::rd_backend, RelationData::rd_locator, RelationData::rd_smgr, smgropen(), smgrpin(), and unlikely.
Referenced by _hash_alloc_buckets(), autoprewarm_database_main(), bt_index_check_internal(), ExtendBufferedRelBy(), ExtendBufferedRelTo(), FlushRelationBuffers(), FreeSpaceMapPrepareTruncateRel(), fsm_does_block_exist(), fsm_readbuf(), gistBuildCallback(), heapam_relation_copy_data(), index_build(), index_copy_data(), pg_prewarm(), pg_truncate_visibility_map(), PrefetchBuffer(), read_stream_begin_relation(), ReadBufferExtended(), RelationGetNumberOfBlocksInFork(), RelationPreTruncate(), RelationTruncate(), smgr_bulk_start_rel(), table_block_relation_size(), visibilitymap_prepare_truncate(), vm_extend(), and vm_readbuf().
void RelationIncrementReferenceCount | ( | Relation | rel | ) |
Definition at line 2159 of file relcache.c.
References CurrentResourceOwner, IsBootstrapProcessingMode, RelationData::rd_refcnt, ResourceOwnerEnlarge(), and ResourceOwnerRememberRelationRef().
Referenced by heap_beginscan(), index_beginscan_internal(), PartitionDirectoryLookup(), RelationBuildLocalRelation(), RelationCacheInitializePhase3(), RelationFlushRelation(), and RelationIdGetRelation().