Remove EXTENSION_DONT_CHECK_SIZE from md.c.
[pgsql.git] / src / include / access / valid.h
blob78c5f023ac420d3e03a6c0218a28e55aeb5c29dd
1 /*-------------------------------------------------------------------------
3 * valid.h
4 * POSTGRES tuple qualification validity definitions.
7 * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/access/valid.h
12 *-------------------------------------------------------------------------
14 #ifndef VALID_H
15 #define VALID_H
17 #include "access/htup.h"
18 #include "access/htup_details.h"
19 #include "access/skey.h"
20 #include "access/tupdesc.h"
23 * HeapKeyTest
25 * Test a heap tuple to see if it satisfies a scan key.
27 static inline bool
28 HeapKeyTest(HeapTuple tuple, TupleDesc tupdesc, int nkeys, ScanKey keys)
30 int cur_nkeys = nkeys;
31 ScanKey cur_key = keys;
33 for (; cur_nkeys--; cur_key++)
35 Datum atp;
36 bool isnull;
37 Datum test;
39 if (cur_key->sk_flags & SK_ISNULL)
40 return false;
42 atp = heap_getattr(tuple, cur_key->sk_attno, tupdesc, &isnull);
44 if (isnull)
45 return false;
47 test = FunctionCall2Coll(&cur_key->sk_func,
48 cur_key->sk_collation,
49 atp, cur_key->sk_argument);
51 if (!DatumGetBool(test))
52 return false;
55 return true;
58 #endif /* VALID_H */