Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "postgres.h"
00016
00017 #include "access/skey.h"
00018 #include "catalog/pg_collation.h"
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 void
00032 ScanKeyEntryInitialize(ScanKey entry,
00033 int flags,
00034 AttrNumber attributeNumber,
00035 StrategyNumber strategy,
00036 Oid subtype,
00037 Oid collation,
00038 RegProcedure procedure,
00039 Datum argument)
00040 {
00041 entry->sk_flags = flags;
00042 entry->sk_attno = attributeNumber;
00043 entry->sk_strategy = strategy;
00044 entry->sk_subtype = subtype;
00045 entry->sk_collation = collation;
00046 entry->sk_argument = argument;
00047 if (RegProcedureIsValid(procedure))
00048 {
00049 fmgr_info(procedure, &entry->sk_func);
00050 }
00051 else
00052 {
00053 Assert(flags & (SK_SEARCHNULL | SK_SEARCHNOTNULL));
00054 MemSet(&entry->sk_func, 0, sizeof(entry->sk_func));
00055 }
00056 }
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 void
00076 ScanKeyInit(ScanKey entry,
00077 AttrNumber attributeNumber,
00078 StrategyNumber strategy,
00079 RegProcedure procedure,
00080 Datum argument)
00081 {
00082 entry->sk_flags = 0;
00083 entry->sk_attno = attributeNumber;
00084 entry->sk_strategy = strategy;
00085 entry->sk_subtype = InvalidOid;
00086 entry->sk_collation = DEFAULT_COLLATION_OID;
00087 entry->sk_argument = argument;
00088 fmgr_info(procedure, &entry->sk_func);
00089 }
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 void
00101 ScanKeyEntryInitializeWithInfo(ScanKey entry,
00102 int flags,
00103 AttrNumber attributeNumber,
00104 StrategyNumber strategy,
00105 Oid subtype,
00106 Oid collation,
00107 FmgrInfo *finfo,
00108 Datum argument)
00109 {
00110 entry->sk_flags = flags;
00111 entry->sk_attno = attributeNumber;
00112 entry->sk_strategy = strategy;
00113 entry->sk_subtype = subtype;
00114 entry->sk_collation = collation;
00115 entry->sk_argument = argument;
00116 fmgr_info_copy(&entry->sk_func, finfo, CurrentMemoryContext);
00117 }