PostgreSQL Source Code  git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
skey.h File Reference
#include "access/attnum.h"
#include "access/stratnum.h"
#include "fmgr.h"
Include dependency graph for skey.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ScanKeyData
 

Macros

#define SK_ISNULL   0x0001 /* sk_argument is NULL */
 
#define SK_UNARY   0x0002 /* unary operator (not supported!) */
 
#define SK_ROW_HEADER   0x0004 /* row comparison header (see above) */
 
#define SK_ROW_MEMBER   0x0008 /* row comparison member (see above) */
 
#define SK_ROW_END   0x0010 /* last row comparison member */
 
#define SK_SEARCHARRAY   0x0020 /* scankey represents ScalarArrayOp */
 
#define SK_SEARCHNULL   0x0040 /* scankey represents "col IS NULL" */
 
#define SK_SEARCHNOTNULL   0x0080 /* scankey represents "col IS NOT NULL" */
 
#define SK_ORDER_BY   0x0100 /* scankey is for ORDER BY op */
 

Typedefs

typedef struct ScanKeyData ScanKeyData
 
typedef ScanKeyDataScanKey
 

Functions

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

Macro Definition Documentation

◆ SK_ISNULL

#define SK_ISNULL   0x0001 /* sk_argument is NULL */

Definition at line 115 of file skey.h.

◆ SK_ORDER_BY

#define SK_ORDER_BY   0x0100 /* scankey is for ORDER BY op */

Definition at line 123 of file skey.h.

◆ SK_ROW_END

#define SK_ROW_END   0x0010 /* last row comparison member */

Definition at line 119 of file skey.h.

◆ SK_ROW_HEADER

#define SK_ROW_HEADER   0x0004 /* row comparison header (see above) */

Definition at line 117 of file skey.h.

◆ SK_ROW_MEMBER

#define SK_ROW_MEMBER   0x0008 /* row comparison member (see above) */

Definition at line 118 of file skey.h.

◆ SK_SEARCHARRAY

#define SK_SEARCHARRAY   0x0020 /* scankey represents ScalarArrayOp */

Definition at line 120 of file skey.h.

◆ SK_SEARCHNOTNULL

#define SK_SEARCHNOTNULL   0x0080 /* scankey represents "col IS NOT NULL" */

Definition at line 122 of file skey.h.

◆ SK_SEARCHNULL

#define SK_SEARCHNULL   0x0040 /* scankey represents "col IS NULL" */

Definition at line 121 of file skey.h.

◆ SK_UNARY

#define SK_UNARY   0x0002 /* unary operator (not supported!) */

Definition at line 116 of file skey.h.

Typedef Documentation

◆ ScanKey

typedef ScanKeyData* ScanKey

Definition at line 75 of file skey.h.

◆ ScanKeyData

typedef struct ScanKeyData ScanKeyData

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:756
#define Assert(condition)
Definition: c.h:837
#define MemSet(start, val, len)
Definition: c.h:999
void fmgr_info(Oid functionId, FmgrInfo *finfo)
Definition: fmgr.c:127
#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:580
MemoryContext CurrentMemoryContext
Definition: mcxt.c:143

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(), create_toast_table(), 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(), dropconstraint_internal(), dropDatabaseDependencies(), dropdb(), DropObjectById(), DropRole(), DropSetting(), DropTableSpace(), EnableDisableTrigger(), enum_endpoint(), enum_range_internal(), EnumValuesDelete(), EventTriggerOnLogin(), ExecAlterExtensionStmt(), ExecGrant_Largeobject(), extension_config_remove(), fetch_statentries_for_relation(), find_composite_type_dependencies(), find_inheritance_children_extended(), find_typed_table_dependencies(), findDependentObjects(), findDomainNotNullConstraint(), findNotNullConstraintAttnum(), get_catalog_object_by_oid(), get_database_oid(), get_db_info(), get_domain_constraint_oid(), 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(), LargeObjectExistsWithSnapshot(), load_domaintype_info(), load_enum_cache_data(), lookup_ts_config_cache(), LookupOpclassInfo(), makeConfigurationDependencies(), MakeConfigurationMapping(), MarkInheritDetached(), MergeConstraintsIntoExisting(), MergeWithExistingConstraint(), movedb(), 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(), RelationGetNotNullConstraints(), RelationGetStatExtList(), RelationRemoveInheritance(), RememberAllDependentForRebuilding(), RemoveAttrDefault(), RemoveAttrDefaultById(), RemoveExtensionById(), RemoveInheritance(), RemovePolicyById(), RemoveRewriteRuleById(), RemoveRoleFromInitPriv(), RemoveRoleFromObjectACL(), RemoveRoleFromObjectPolicy(), RemoveStatistics(), RemoveSubscriptionRel(), RemoveTriggerById(), RemoveTSConfigurationById(), rename_policy(), RenameTableSpace(), renametrig(), renametrig_internal(), renametrig_partition(), ReplaceRoleInInitPriv(), 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(), vac_update_relstats(), and validatePartitionedIndex().