PostgreSQL Source Code  git master
scankey.c File Reference
#include "postgres.h"
#include "access/skey.h"
#include "catalog/pg_collation.h"
Include dependency graph for scankey.c:

Go to the source code of this file.

Functions

void ScanKeyEntryInitialize (ScanKey entry, int flags, AttrNumber attributeNumber, StrategyNumber strategy, Oid subtype, Oid collation, RegProcedure procedure, Datum argument)
 
void ScanKeyInit (ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
 
void ScanKeyEntryInitializeWithInfo (ScanKey entry, int flags, AttrNumber attributeNumber, StrategyNumber strategy, Oid subtype, Oid collation, FmgrInfo *finfo, Datum argument)
 

Function Documentation

◆ ScanKeyEntryInitialize()

void ScanKeyEntryInitialize ( ScanKey  entry,
int  flags,
AttrNumber  attributeNumber,
StrategyNumber  strategy,
Oid  subtype,
Oid  collation,
RegProcedure  procedure,
Datum  argument 
)

Definition at line 32 of file scankey.c.

40 {
41  entry->sk_flags = flags;
42  entry->sk_attno = attributeNumber;
43  entry->sk_strategy = strategy;
44  entry->sk_subtype = subtype;
45  entry->sk_collation = collation;
46  entry->sk_argument = argument;
47  if (RegProcedureIsValid(procedure))
48  {
49  fmgr_info(procedure, &entry->sk_func);
50  }
51  else
52  {
54  MemSet(&entry->sk_func, 0, sizeof(entry->sk_func));
55  }
56 }
#define RegProcedureIsValid(p)
Definition: c.h:713
#define MemSet(start, val, len)
Definition: c.h:953
void fmgr_info(Oid functionId, FmgrInfo *finfo)
Definition: fmgr.c:126
Assert(fmt[strlen(fmt) - 1] !='\n')
#define SK_SEARCHNOTNULL
Definition: skey.h:122
#define SK_SEARCHNULL
Definition: skey.h:121
int sk_flags
Definition: skey.h:66
Datum sk_argument
Definition: skey.h:72
FmgrInfo sk_func
Definition: skey.h:71
Oid sk_subtype
Definition: skey.h:69
Oid sk_collation
Definition: skey.h:70
StrategyNumber sk_strategy
Definition: skey.h:68
AttrNumber sk_attno
Definition: skey.h:67

References Assert(), fmgr_info(), MemSet, RegProcedureIsValid, ScanKeyData::sk_argument, ScanKeyData::sk_attno, ScanKeyData::sk_collation, ScanKeyData::sk_flags, ScanKeyData::sk_func, SK_SEARCHNOTNULL, SK_SEARCHNULL, ScanKeyData::sk_strategy, and ScanKeyData::sk_subtype.

Referenced by _bt_first(), check_exclusion_or_unique_constraint(), ExecIndexBuildScanKeys(), and get_actual_variable_range().

◆ ScanKeyEntryInitializeWithInfo()

void ScanKeyEntryInitializeWithInfo ( ScanKey  entry,
int  flags,
AttrNumber  attributeNumber,
StrategyNumber  strategy,
Oid  subtype,
Oid  collation,
FmgrInfo finfo,
Datum  argument 
)

Definition at line 101 of file scankey.c.

109 {
110  entry->sk_flags = flags;
111  entry->sk_attno = attributeNumber;
112  entry->sk_strategy = strategy;
113  entry->sk_subtype = subtype;
114  entry->sk_collation = collation;
115  entry->sk_argument = argument;
117 }
void fmgr_info_copy(FmgrInfo *dstinfo, FmgrInfo *srcinfo, MemoryContext destcxt)
Definition: fmgr.c:594
MemoryContext CurrentMemoryContext
Definition: mcxt.c:124

References CurrentMemoryContext, fmgr_info_copy(), ScanKeyData::sk_argument, ScanKeyData::sk_attno, ScanKeyData::sk_collation, ScanKeyData::sk_flags, ScanKeyData::sk_func, ScanKeyData::sk_strategy, and ScanKeyData::sk_subtype.

Referenced by _bt_first(), and _bt_mkscankey().

◆ ScanKeyInit()

void ScanKeyInit ( ScanKey  entry,
AttrNumber  attributeNumber,
StrategyNumber  strategy,
RegProcedure  procedure,
Datum  argument 
)

Definition at line 76 of file scankey.c.

81 {
82  entry->sk_flags = 0;
83  entry->sk_attno = attributeNumber;
84  entry->sk_strategy = strategy;
85  entry->sk_subtype = InvalidOid;
86  entry->sk_collation = C_COLLATION_OID;
87  entry->sk_argument = argument;
88  fmgr_info(procedure, &entry->sk_func);
89 }
#define InvalidOid
Definition: postgres_ext.h:36

References fmgr_info(), InvalidOid, ScanKeyData::sk_argument, ScanKeyData::sk_attno, ScanKeyData::sk_collation, ScanKeyData::sk_flags, ScanKeyData::sk_func, ScanKeyData::sk_strategy, and ScanKeyData::sk_subtype.

Referenced by AfterTriggerSetState(), AlterConstraintNamespaces(), AlterDatabase(), AlterDatabaseOwner(), AlterDatabaseRefreshColl(), AlterDomainDropConstraint(), AlterDomainValidateConstraint(), AlterExtensionNamespace(), AlterPolicy(), AlterSeqNamespaces(), AlterSetting(), AlterTableMoveAll(), AlterTableSpaceOptions(), AlterTypeRecurse(), ApplyExtensionUpdates(), ApplySetting(), ATExecAddOf(), ATExecAlterColumnType(), ATExecAlterConstraint(), ATExecAlterConstrRecurse(), ATExecAttachPartition(), ATExecDropConstraint(), ATExecValidateConstraint(), ATPrepChangePersistence(), AttrDefaultFetch(), build_replindex_scan_key(), change_owner_fix_column_acls(), change_owner_recurse_to_sequences(), changeDependenciesOf(), changeDependenciesOn(), changeDependencyFor(), check_toasted_attribute(), CheckConstraintFetch(), checkSharedDependencies(), ChooseConstraintName(), CloneFkReferenced(), CloneRowTriggersToPartition(), ConstraintNameExists(), ConstraintNameIsUsed(), CopyStatistics(), copyTemplateDependencies(), CountDBSubscriptions(), CreateComments(), CreateInheritance(), CreatePolicy(), CreateSharedComments(), CreateTriggerFiringOn(), DefineOpClass(), DefineTSConfiguration(), DeleteAttributeTuples(), DeleteComments(), deleteDependencyRecordsFor(), deleteDependencyRecordsForClass(), deleteDependencyRecordsForSpecific(), DeleteInheritsTuple(), DeleteInitPrivs(), deleteOneObject(), DeleteSecurityLabel(), DeleteSharedComments(), DeleteSharedSecurityLabel(), DeleteSystemAttributeTuples(), do_autovacuum(), drop_parent_dependency(), DropClonedTriggersFromPartition(), DropConfigurationMapping(), dropDatabaseDependencies(), DropObjectById(), DropRole(), DropSetting(), DropTableSpace(), EnableDisableTrigger(), enum_endpoint(), enum_range_internal(), EnumValuesDelete(), ExecAlterExtensionStmt(), ExecGrant_Largeobject(), extension_config_remove(), fetch_statentries_for_relation(), find_composite_type_dependencies(), find_inheritance_children_extended(), find_typed_table_dependencies(), findDependentObjects(), get_catalog_object_by_oid(), get_database_oid(), get_db_info(), get_domain_constraint_oid(), get_extension_name(), get_extension_oid(), get_extension_schema(), get_index_constraint(), get_index_ref_constraints(), get_partition_parent_worker(), get_pkey_attnames(), get_primary_key_attnos(), get_relation_constraint_attnos(), get_relation_constraint_oid(), get_relation_idx_constraint_oid(), get_relation_policy_oid(), get_rels_with_domain(), get_tables_to_cluster(), get_tablespace_name(), get_tablespace_oid(), get_trigger_oid(), GetAllTablesPublicationRelations(), GetAllTablesPublications(), GetAttrDefaultColumnAddress(), GetAttrDefaultOid(), getAutoExtensionsOfObject(), GetComment(), GetDatabaseTuple(), GetDatabaseTupleByOid(), GetDefaultOpClass(), getExtensionOfObject(), GetForeignKeyActionTriggers(), GetForeignKeyCheckTriggers(), GetNewOidWithIndex(), getObjectDescription(), getObjectIdentityParts(), getOwnedSequences_internal(), GetParentedForeignKeyRefs(), GetPublicationRelations(), GetPublicationSchemas(), getRelationsInNamespace(), GetSchemaPublicationRelations(), GetSecurityLabel(), GetSharedSecurityLabel(), GetSubscriptionRelations(), has_superclass(), HasSubscriptionRelations(), heap_fetch_toast_slice(), heap_truncate_find_FKs(), index_concurrently_swap(), index_update_stats(), IndexSetParentIndex(), inv_getsize(), inv_read(), inv_truncate(), inv_write(), is_schema_publication(), LargeObjectDrop(), LargeObjectExists(), load_domaintype_info(), load_enum_cache_data(), lookup_ts_config_cache(), LookupOpclassInfo(), makeConfigurationDependencies(), MakeConfigurationMapping(), MarkInheritDetached(), MergeConstraintsIntoExisting(), MergeWithExistingConstraint(), movedb(), myLargeObjectExists(), object_ownercheck(), objectsInSchemaToOids(), PartitionHasPendingDetach(), pg_extension_config_dump(), pg_get_constraintdef_worker(), pg_get_serial_sequence(), pg_get_triggerdef_worker(), pg_largeobject_aclmask_snapshot(), RangeDelete(), recordExtensionInitPrivWorker(), recordExtObjInitPriv(), ReindexMultipleTables(), relation_has_policies(), RelationBuildPartitionDesc(), RelationBuildRowSecurity(), RelationBuildRuleLock(), RelationBuildTriggers(), RelationBuildTupleDesc(), RelationGetExclusionInfo(), RelationGetFKeyList(), RelationGetIndexList(), RelationGetStatExtList(), RelationRemoveInheritance(), RemoveAttrDefault(), RemoveAttrDefaultById(), RemoveExtensionById(), RemoveInheritance(), RemovePolicyById(), RemoveRewriteRuleById(), RemoveRoleFromObjectACL(), RemoveRoleFromObjectPolicy(), RemoveStatistics(), RemoveSubscriptionRel(), RemoveTriggerById(), RemoveTSConfigurationById(), rename_policy(), RenameTableSpace(), renametrig(), renametrig_internal(), renametrig_partition(), replorigin_create(), ScanPgRelation(), sepgsql_attribute_post_create(), sepgsql_database_post_create(), sepgsql_proc_post_create(), sepgsql_proc_setattr(), sepgsql_relation_post_create(), sepgsql_relation_setattr(), sepgsql_relation_setattr_extra(), sepgsql_schema_post_create(), sequenceIsOwned(), SetSecurityLabel(), SetSharedSecurityLabel(), shdepChangeDep(), shdepDropDependency(), shdepDropOwned(), shdepReassignOwned(), toast_delete_datum(), toastrel_valueid_exists(), TriggerSetParentTrigger(), tryAttachPartitionForeignKey(), typeInheritsFrom(), vac_update_datfrozenxid(), and validatePartitionedIndex().