1 /*-------------------------------------------------------------------------
3 * pg_partitioned_table.h
4 * definition of the system "partitioned table" relation
5 * along with the relation's initial contents.
8 * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
10 * src/include/catalog/pg_partitioned_table.h
13 * the genbki.sh script reads this file and generates .bki
14 * information from the DATA() statements.
16 *-------------------------------------------------------------------------
18 #ifndef PG_PARTITIONED_TABLE_H
19 #define PG_PARTITIONED_TABLE_H
21 #include "catalog/genbki.h"
24 * pg_partitioned_table definition. cpp turns this into
25 * typedef struct FormData_pg_partitioned_table
28 #define PartitionedRelationId 3350
30 CATALOG(pg_partitioned_table,3350) BKI_WITHOUT_OIDS
32 Oid partrelid; /* partitioned table oid */
33 char partstrat; /* partitioning strategy */
34 int16 partnatts; /* number of partition key columns */
35 Oid partdefid; /* default partition oid; InvalidOid if there
39 * variable-length fields start here, but we allow direct access to
40 * partattrs via the C struct. That's because the first variable-length
41 * field of a heap tuple can be reliably accessed using its C struct
42 * offset, as previous fields are all non-nullable fixed-length fields.
44 int2vector partattrs; /* each member of the array is the attribute
45 * number of a partition key column, or 0 if
46 * the column is actually an expression */
49 oidvector partclass; /* operator class to compare keys */
50 oidvector partcollation; /* user-specified collation for keys */
51 pg_node_tree partexprs; /* list of expressions in the partition key;
52 * one item for each zero entry in partattrs[] */
54 } FormData_pg_partitioned_table;
57 * Form_pg_partitioned_table corresponds to a pointer to a tuple with
58 * the format of pg_partitioned_table relation.
61 typedef FormData_pg_partitioned_table *Form_pg_partitioned_table;
64 * compiler constants for pg_partitioned_table
67 #define Natts_pg_partitioned_table 8
68 #define Anum_pg_partitioned_table_partrelid 1
69 #define Anum_pg_partitioned_table_partstrat 2
70 #define Anum_pg_partitioned_table_partnatts 3
71 #define Anum_pg_partitioned_table_partdefid 4
72 #define Anum_pg_partitioned_table_partattrs 5
73 #define Anum_pg_partitioned_table_partclass 6
74 #define Anum_pg_partitioned_table_partcollation 7
75 #define Anum_pg_partitioned_table_partexprs 8
77 #endif /* PG_PARTITIONED_TABLE_H */