PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/genam.h"
#include "access/relscan.h"
#include "access/tableam.h"
#include "access/transam.h"
#include "access/xact.h"
#include "catalog/pg_am_d.h"
#include "commands/trigger.h"
#include "executor/executor.h"
#include "executor/nodeModifyTable.h"
#include "replication/conflict.h"
#include "replication/logicalrelation.h"
#include "storage/lmgr.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/rel.h"
#include "utils/snapmgr.h"
#include "utils/syscache.h"
#include "utils/typcache.h"
Go to the source code of this file.
|
static |
Definition at line 97 of file execReplication.c.
References Assert, AttributeNumberIsValid, DatumGetPointer(), elog, ERROR, get_equal_strategy_number(), get_opclass_family(), get_opclass_input_type(), get_opcode(), get_opfamily_member(), IndexRelationGetNumberOfKeyAttributes, OidIsValid, RelationData::rd_indcollation, RelationData::rd_index, RelationData::rd_indextuple, ScanKeyInit(), ScanKeyData::sk_collation, ScanKeyData::sk_flags, SK_ISNULL, SK_SEARCHNULL, SysCacheGetAttrNotNull(), TupleTableSlot::tts_isnull, TupleTableSlot::tts_values, int2vector::values, and oidvector::values.
Referenced by RelationFindReplTupleByIndex().
|
static |
Definition at line 535 of file execReplication.c.
References ERROR, FindConflictTuple(), foreach_oid, GetTupleTransactionInfo(), list_member_oid(), ReportApplyConflict(), ResultRelInfo::ri_onConflictArbiterIndexes, and type.
Referenced by ExecSimpleRelationInsert(), and ExecSimpleRelationUpdate().
Definition at line 772 of file execReplication.c.
References CMD_DELETE, CMD_UPDATE, PublicationDesc::cols_valid_for_delete, PublicationDesc::cols_valid_for_update, ereport, errcode(), errdetail(), errhint(), errmsg(), ERROR, OidIsValid, PublicationDesc::pubactions, PublicationActions::pubdelete, PublicationActions::pubupdate, RelationData::rd_rel, RelationBuildPublicationDesc(), RelationGetRelationName, RelationGetReplicaIndex(), PublicationDesc::rf_valid_for_delete, and PublicationDesc::rf_valid_for_update.
Referenced by CheckValidResultRel(), ExecSimpleRelationDelete(), ExecSimpleRelationInsert(), and ExecSimpleRelationUpdate().
void CheckSubscriptionRelkind | ( | char | relkind, |
const char * | nspname, | ||
const char * | relname | ||
) |
Definition at line 859 of file execReplication.c.
References ereport, errcode(), errdetail_relkind_not_supported(), errmsg(), ERROR, and relname.
Referenced by AlterSubscription_refresh(), apply_handle_tuple_routing(), CreateSubscription(), and logicalrep_rel_open().
void ExecSimpleRelationDelete | ( | ResultRelInfo * | resultRelInfo, |
EState * | estate, | ||
EPQState * | epqstate, | ||
TupleTableSlot * | searchslot | ||
) |
Definition at line 739 of file execReplication.c.
References CheckCmdReplicaIdentity(), CMD_DELETE, EState::es_snapshot, ExecARDeleteTriggers(), ExecBRDeleteTriggers(), ResultRelInfo::ri_RelationDesc, ResultRelInfo::ri_TrigDesc, simple_table_tuple_delete(), TriggerDesc::trig_delete_before_row, and TupleTableSlot::tts_tid.
Referenced by apply_handle_delete_internal(), and apply_handle_tuple_routing().
void ExecSimpleRelationInsert | ( | ResultRelInfo * | resultRelInfo, |
EState * | estate, | ||
TupleTableSlot * | slot | ||
) |
Definition at line 567 of file execReplication.c.
References Assert, CheckAndReportConflict(), CheckCmdReplicaIdentity(), CMD_INSERT, TupleDescData::constr, CT_INSERT_EXISTS, ExecARInsertTriggers(), ExecBRInsertTriggers(), ExecComputeStoredGenerated(), ExecConstraints(), ExecInsertIndexTuples(), ExecPartitionCheck(), TupleConstr::has_generated_stored, list_free(), NIL, RelationData::rd_att, RelationData::rd_rel, ResultRelInfo::ri_NumIndices, ResultRelInfo::ri_onConflictArbiterIndexes, ResultRelInfo::ri_RelationDesc, ResultRelInfo::ri_TrigDesc, simple_table_tuple_insert(), and TriggerDesc::trig_insert_before_row.
Referenced by apply_handle_insert_internal().
void ExecSimpleRelationUpdate | ( | ResultRelInfo * | resultRelInfo, |
EState * | estate, | ||
EPQState * | epqstate, | ||
TupleTableSlot * | searchslot, | ||
TupleTableSlot * | slot | ||
) |
Definition at line 656 of file execReplication.c.
References Assert, CheckAndReportConflict(), CheckCmdReplicaIdentity(), CMD_UPDATE, TupleDescData::constr, CT_UPDATE_EXISTS, EState::es_snapshot, ExecARUpdateTriggers(), ExecBRUpdateTriggers(), ExecComputeStoredGenerated(), ExecConstraints(), ExecInsertIndexTuples(), ExecPartitionCheck(), TupleConstr::has_generated_stored, IsCatalogRelation(), list_free(), NIL, RelationData::rd_att, RelationData::rd_rel, ResultRelInfo::ri_NumIndices, ResultRelInfo::ri_onConflictArbiterIndexes, ResultRelInfo::ri_RelationDesc, ResultRelInfo::ri_TrigDesc, simple_table_tuple_update(), TriggerDesc::trig_update_before_row, TupleTableSlot::tts_tid, TU_None, and TU_Summarizing.
Referenced by apply_handle_tuple_routing(), and apply_handle_update_internal().
|
static |
Definition at line 487 of file execReplication.c.
References ExecCheckIndexConstraints(), ExecDropSingleTupleTableSlot(), GetCurrentCommandId(), GetLatestSnapshot(), list_make1_oid, LockTupleShare, LockWaitBlock, PopActiveSnapshot(), PushActiveSnapshot(), res, ResultRelInfo::ri_RelationDesc, should_refetch_tuple(), table_slot_create(), table_tuple_lock(), and TupleTableSlot::tts_tid.
Referenced by CheckAndReportConflict().
|
static |
Definition at line 76 of file execReplication.c.
References get_equal_strategy_number_for_am(), and get_opclass_method().
Referenced by build_replindex_scan_key().
StrategyNumber get_equal_strategy_number_for_am | ( | Oid | am | ) |
Definition at line 50 of file execReplication.c.
References BTEqualStrategyNumber, HTEqualStrategyNumber, and InvalidStrategy.
Referenced by get_equal_strategy_number(), and IsIndexUsableForReplicaIdentityFull().
bool RelationFindReplTupleByIndex | ( | Relation | rel, |
Oid | idxoid, | ||
LockTupleMode | lockmode, | ||
TupleTableSlot * | searchslot, | ||
TupleTableSlot * | outslot | ||
) |
Definition at line 222 of file execReplication.c.
References build_replindex_scan_key(), ExecMaterializeSlot(), ForwardScanDirection, GetCurrentCommandId(), GetLatestSnapshot(), GetRelationIdentityOrPK(), index_beginscan(), index_close(), index_endscan(), index_getnext_slot(), INDEX_MAX_KEYS, index_open(), index_rescan(), InitDirtySnapshot, LockWaitBlock, TupleDescData::natts, NoLock, palloc0(), PopActiveSnapshot(), PushActiveSnapshot(), res, RowExclusiveLock, should_refetch_tuple(), table_tuple_lock(), TransactionIdIsValid, TupleTableSlot::tts_tid, TupleTableSlot::tts_tupleDescriptor, tuples_equal(), XactLockTableWait(), XLTW_None, SnapshotData::xmax, and SnapshotData::xmin.
Referenced by FindReplTupleInLocalRel().
bool RelationFindReplTupleSeq | ( | Relation | rel, |
LockTupleMode | lockmode, | ||
TupleTableSlot * | searchslot, | ||
TupleTableSlot * | outslot | ||
) |
Definition at line 398 of file execReplication.c.
References Assert, equalTupleDescs(), ExecCopySlot(), ExecDropSingleTupleTableSlot(), ForwardScanDirection, GetCurrentCommandId(), GetLatestSnapshot(), InitDirtySnapshot, LockWaitBlock, TupleDescData::natts, palloc0(), PG_USED_FOR_ASSERTS_ONLY, PopActiveSnapshot(), PushActiveSnapshot(), RelationGetDescr, res, should_refetch_tuple(), table_beginscan(), table_endscan(), table_rescan(), table_scan_getnextslot(), table_slot_create(), table_tuple_lock(), TransactionIdIsValid, TupleTableSlot::tts_tid, TupleTableSlot::tts_tupleDescriptor, tuples_equal(), XactLockTableWait(), XLTW_None, SnapshotData::xmax, and SnapshotData::xmin.
Referenced by FindReplTupleInLocalRel().
|
static |
Definition at line 177 of file execReplication.c.
References TM_FailureData::ctid, elog, ereport, errcode(), ERRCODE_T_R_SERIALIZATION_FAILURE, errmsg(), ERROR, ItemPointerIndicatesMovedPartitions(), LOG, res, TM_Deleted, TM_Invisible, TM_Ok, and TM_Updated.
Referenced by FindConflictTuple(), RelationFindReplTupleByIndex(), and RelationFindReplTupleSeq().
|
static |
Definition at line 325 of file execReplication.c.
References Assert, DatumGetBool(), TypeCacheEntry::eq_opr_finfo, ereport, errcode(), errmsg(), ERROR, FmgrInfo::fn_oid, format_type_be(), FunctionCall2Coll(), lookup_type_cache(), TupleDescData::natts, OidIsValid, slot_getallattrs(), TupleTableSlot::tts_isnull, TupleTableSlot::tts_tupleDescriptor, TupleTableSlot::tts_values, TupleDescAttr, and TYPECACHE_EQ_OPR_FINFO.
Referenced by RelationFindReplTupleByIndex(), and RelationFindReplTupleSeq().