1/*-------------------------------------------------------------------------
2 *
3 * partdesc.h
4 *
5 * Copyright (c) 1996-2019, PostgreSQL Global Development Group
6 *
7 * src/include/utils/partdesc.h
8 *
9 *-------------------------------------------------------------------------
10 */
11
12#ifndef PARTDESC_H
13#define PARTDESC_H
14
15#include "partitioning/partdefs.h"
16#include "utils/relcache.h"
17
18/*
19 * Information about partitions of a partitioned table.
20 */
21typedef struct PartitionDescData
22{
23 int nparts; /* Number of partitions */
24 Oid *oids; /* Array of 'nparts' elements containing
25 * partition OIDs in order of the their bounds */
26 bool *is_leaf; /* Array of 'nparts' elements storing whether
27 * the corresponding 'oids' element belongs to
28 * a leaf partition or not */
29 PartitionBoundInfo boundinfo; /* collection of partition bounds */
30} PartitionDescData;
31
32extern void RelationBuildPartitionDesc(Relation rel);
33
34extern PartitionDirectory CreatePartitionDirectory(MemoryContext mcxt);
35extern PartitionDesc PartitionDirectoryLookup(PartitionDirectory, Relation);
36extern void DestroyPartitionDirectory(PartitionDirectory pdir);
37
38extern Oid get_default_oid_from_partdesc(PartitionDesc partdesc);
39
40extern bool equalPartitionDescs(PartitionKey key, PartitionDesc partdesc1,
41 PartitionDesc partdesc2);
42
43#endif /* PARTCACHE_H */
44