PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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

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.

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().

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 }
Oid sk_subtype
Definition: skey.h:69
#define MemSet(start, val, len)
Definition: c.h:857
void fmgr_info(Oid functionId, FmgrInfo *finfo)
Definition: fmgr.c:159
StrategyNumber sk_strategy
Definition: skey.h:68
#define RegProcedureIsValid(p)
Definition: c.h:540
FmgrInfo sk_func
Definition: skey.h:71
#define SK_SEARCHNOTNULL
Definition: skey.h:122
int sk_flags
Definition: skey.h:66
#define Assert(condition)
Definition: c.h:675
Oid sk_collation
Definition: skey.h:70
Datum sk_argument
Definition: skey.h:72
#define SK_SEARCHNULL
Definition: skey.h:121
AttrNumber sk_attno
Definition: skey.h:67
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.

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(), _bt_mkscankey(), and _bt_mkscankey_nodata().

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 }
Oid sk_subtype
Definition: skey.h:69
StrategyNumber sk_strategy
Definition: skey.h:68
void fmgr_info_copy(FmgrInfo *dstinfo, FmgrInfo *srcinfo, MemoryContext destcxt)
Definition: fmgr.c:583
FmgrInfo sk_func
Definition: skey.h:71
MemoryContext CurrentMemoryContext
Definition: mcxt.c:37
int sk_flags
Definition: skey.h:66
Oid sk_collation
Definition: skey.h:70
Datum sk_argument
Definition: skey.h:72
AttrNumber sk_attno
Definition: skey.h:67
void ScanKeyInit ( ScanKey  entry,
AttrNumber  attributeNumber,
StrategyNumber  strategy,
RegProcedure  procedure,
Datum  argument 
)

Definition at line 76 of file scankey.c.

References DEFAULT_COLLATION_OID, 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(), AlterDomainDropConstraint(), AlterDomainValidateConstraint(), AlterExtensionNamespace(), AlterPolicy(), AlterSeqNamespaces(), AlterSetting(), AlterTableMoveAll(), AlterTableSpaceOptions(), ApplyExtensionUpdates(), ApplySetting(), ATExecAddOf(), ATExecAlterColumnType(), ATExecAlterConstraint(), ATExecAttachPartition(), ATExecDropConstraint(), ATExecValidateConstraint(), ATPrepChangePersistence(), AttrDefaultFetch(), build_replindex_scan_key(), change_owner_fix_column_acls(), change_owner_recurse_to_sequences(), changeDependencyFor(), CheckConstraintFetch(), checkSharedDependencies(), ChooseConstraintName(), ConstraintNameIsUsed(), copyTemplateDependencies(), CountDBSubscriptions(), CreateComments(), CreateInheritance(), CreatePolicy(), CreateSharedComments(), CreateTrigger(), DefineOpClass(), DefineTSConfiguration(), DeleteAttributeTuples(), DeleteComments(), deleteDependencyRecordsFor(), deleteDependencyRecordsForClass(), DeleteInitPrivs(), deleteOneObject(), DeleteSecurityLabel(), DeleteSharedComments(), DeleteSharedSecurityLabel(), DeleteSystemAttributeTuples(), do_autovacuum(), drop_parent_dependency(), DropCastById(), DropConfigurationMapping(), dropDatabaseDependencies(), DropRole(), DropSetting(), DropTableSpace(), DropTransformById(), EnableDisableTrigger(), enum_endpoint(), enum_range_internal(), EnumValuesDelete(), ExecAlterExtensionStmt(), ExecGrant_Largeobject(), extension_config_remove(), fetch_statentries_for_relation(), find_composite_type_dependencies(), find_inheritance_children(), find_language_template(), find_typed_table_dependencies(), findDependentObjects(), get_catalog_object_by_oid(), get_constraint_index(), get_database_oid(), get_db_info(), get_domain_constraint_oid(), get_extension_name(), get_extension_oid(), get_extension_schema(), get_index_constraint(), get_object_address_attrdef(), get_partition_parent(), get_pkey_attnames(), get_primary_key_attnos(), get_relation_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(), GetComment(), GetDatabaseTuple(), GetDatabaseTupleByOid(), GetDefaultOpClass(), getExtensionOfObject(), GetNewOidWithIndex(), getObjectDescription(), getObjectIdentityParts(), getOwnedSequences(), GetPublicationRelations(), getRelationsInNamespace(), GetSecurityLabel(), GetSharedSecurityLabel(), GetSubscriptionNotReadyRelations(), GetSubscriptionRelations(), index_update_stats(), inv_getsize(), inv_read(), inv_truncate(), inv_write(), isObjectPinned(), isSharedObjectPinned(), LargeObjectDrop(), LargeObjectExists(), load_domaintype_info(), load_enum_cache_data(), lookup_ts_config_cache(), LookupOpclassInfo(), makeConfigurationDependencies(), MakeConfigurationMapping(), MergeConstraintsIntoExisting(), MergeWithExistingConstraint(), movedb(), myLargeObjectExists(), objectsInSchemaToOids(), pg_extension_config_dump(), pg_extension_ownercheck(), pg_get_constraintdef_worker(), pg_get_serial_sequence(), pg_get_triggerdef_worker(), pg_largeobject_aclmask_snapshot(), pg_largeobject_ownercheck(), RangeDelete(), recordExtensionInitPrivWorker(), recordExtObjInitPriv(), regclassin(), regoperin(), regprocin(), regtypein(), ReindexMultipleTables(), relation_has_policies(), RelationBuildRowSecurity(), RelationBuildRuleLock(), RelationBuildTriggers(), RelationBuildTupleDesc(), RelationGetExclusionInfo(), RelationGetFKeyList(), RelationGetIndexList(), RelationGetStatExtList(), RelationRemoveInheritance(), RemoveAmOpEntryById(), RemoveAmProcEntryById(), RemoveAttrDefault(), RemoveAttrDefaultById(), RemoveCollationById(), RemoveConversionById(), RemoveDefaultACLById(), RemoveExtensionById(), RemoveInheritance(), RemovePolicyById(), RemoveRewriteRuleById(), RemoveRoleFromObjectACL(), RemoveRoleFromObjectPolicy(), RemoveStatistics(), RemoveStatisticsExt(), RemoveSubscriptionRel(), RemoveTriggerById(), RemoveTSConfigurationById(), rename_policy(), RenameTableSpace(), renametrig(), 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(), toast_fetch_datum(), toast_fetch_datum_slice(), toastrel_valueid_exists(), and typeInheritsFrom().

81 {
82  entry->sk_flags = 0;
83  entry->sk_attno = attributeNumber;
84  entry->sk_strategy = strategy;
85  entry->sk_subtype = InvalidOid;
87  entry->sk_argument = argument;
88  fmgr_info(procedure, &entry->sk_func);
89 }
Oid sk_subtype
Definition: skey.h:69
void fmgr_info(Oid functionId, FmgrInfo *finfo)
Definition: fmgr.c:159
StrategyNumber sk_strategy
Definition: skey.h:68
#define DEFAULT_COLLATION_OID
Definition: pg_collation.h:74
FmgrInfo sk_func
Definition: skey.h:71
#define InvalidOid
Definition: postgres_ext.h:36
int sk_flags
Definition: skey.h:66
Oid sk_collation
Definition: skey.h:70
Datum sk_argument
Definition: skey.h:72
AttrNumber sk_attno
Definition: skey.h:67