summaryrefslogtreecommitdiffstats
path: root/src/include/catalog/indexing.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
commit293913568e6a7a86fd1479e1cff8e2ecb58d6568 (patch)
treefc3b469a3ec5ab71b36ea97cc7aaddb838423a0c /src/include/catalog/indexing.h
parentInitial commit. (diff)
downloadpostgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.tar.xz
postgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.zip
Adding upstream version 16.2.upstream/16.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/include/catalog/indexing.h')
-rw-r--r--src/include/catalog/indexing.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/include/catalog/indexing.h b/src/include/catalog/indexing.h
new file mode 100644
index 0000000..5c06938
--- /dev/null
+++ b/src/include/catalog/indexing.h
@@ -0,0 +1,54 @@
+/*-------------------------------------------------------------------------
+ *
+ * indexing.h
+ * This file provides some definitions to support indexing
+ * on system catalogs
+ *
+ *
+ * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/catalog/indexing.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef INDEXING_H
+#define INDEXING_H
+
+#include "access/htup.h"
+#include "nodes/execnodes.h"
+#include "utils/relcache.h"
+
+/*
+ * The state object used by CatalogOpenIndexes and friends is actually the
+ * same as the executor's ResultRelInfo, but we give it another type name
+ * to decouple callers from that fact.
+ */
+typedef struct ResultRelInfo *CatalogIndexState;
+
+/*
+ * Cap the maximum amount of bytes allocated for multi-inserts with system
+ * catalogs, limiting the number of slots used.
+ */
+#define MAX_CATALOG_MULTI_INSERT_BYTES 65535
+
+/*
+ * indexing.c prototypes
+ */
+extern CatalogIndexState CatalogOpenIndexes(Relation heapRel);
+extern void CatalogCloseIndexes(CatalogIndexState indstate);
+extern void CatalogTupleInsert(Relation heapRel, HeapTuple tup);
+extern void CatalogTupleInsertWithInfo(Relation heapRel, HeapTuple tup,
+ CatalogIndexState indstate);
+extern void CatalogTuplesMultiInsertWithInfo(Relation heapRel,
+ TupleTableSlot **slot,
+ int ntuples,
+ CatalogIndexState indstate);
+extern void CatalogTupleUpdate(Relation heapRel, ItemPointer otid,
+ HeapTuple tup);
+extern void CatalogTupleUpdateWithInfo(Relation heapRel,
+ ItemPointer otid, HeapTuple tup,
+ CatalogIndexState indstate);
+extern void CatalogTupleDelete(Relation heapRel, ItemPointer tid);
+
+#endif /* INDEXING_H */