PostgreSQL Source Code  git master
partition.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * partition.h
4  * Header file for structures and utility functions related to
5  * partitioning
6  *
7  * Copyright (c) 2007-2018, PostgreSQL Global Development Group
8  *
9  * src/include/catalog/partition.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef PARTITION_H
14 #define PARTITION_H
15 
16 #include "fmgr.h"
17 #include "partitioning/partdefs.h"
18 #include "utils/relcache.h"
19 
20 /* Seed for the extended hash function */
21 #define HASH_PARTITION_SEED UINT64CONST(0x7A5B22367996DCFD)
22 
23 /*
24  * Information about partitions of a partitioned table.
25  */
26 typedef struct PartitionDescData
27 {
28  int nparts; /* Number of partitions */
29  Oid *oids; /* OIDs of partitions */
30  PartitionBoundInfo boundinfo; /* collection of partition bounds */
32 
33 extern Oid get_partition_parent(Oid relid);
34 extern List *get_partition_ancestors(Oid relid);
35 extern List *map_partition_varattnos(List *expr, int fromrel_varno,
36  Relation to_rel, Relation from_rel,
37  bool *found_whole_row);
38 extern bool has_partition_attrs(Relation rel, Bitmapset *attnums,
39  bool *used_in_expr);
40 
42 extern Oid get_default_partition_oid(Oid parentId);
43 extern void update_default_partition_oid(Oid parentId, Oid defaultPartId);
44 extern List *get_proposed_default_constraint(List *new_part_constaints);
45 
46 #endif /* PARTITION_H */
unsigned int Oid
Definition: postgres_ext.h:31
Oid get_partition_parent(Oid relid)
Definition: partition.c:53
PartitionBoundInfo boundinfo
Definition: partition.h:30
Oid get_default_partition_oid(Oid parentId)
Definition: partition.c:282
Oid get_default_oid_from_partdesc(PartitionDesc partdesc)
Definition: partition.c:265
void update_default_partition_oid(Oid parentId, Oid defaultPartId)
Definition: partition.c:307
struct PartitionDescData PartitionDescData
bool has_partition_attrs(Relation rel, Bitmapset *attnums, bool *used_in_expr)
Definition: partition.c:206
List * get_partition_ancestors(Oid relid)
Definition: partition.c:118
List * get_proposed_default_constraint(List *new_part_constaints)
Definition: partition.c:337
Definition: pg_list.h:45
List * map_partition_varattnos(List *expr, int fromrel_varno, Relation to_rel, Relation from_rel, bool *found_whole_row)
Definition: partition.c:168