mirror of
https://github.com/postgres/postgres.git
synced 2025-07-12 21:01:52 +03:00
Move code for managing PartitionDescs into a new file, partdesc.c
This is similar in spirit to the existing partbounds.c file in the same directory, except that there's a lot less code in the new file created by this commit. Pending work in this area proposes to add a bunch more code related to PartitionDescs, though, and this will give us a good place to put it. Discussion: http://postgr.es/m/CA+TgmoZUwPf_uanjF==gTGBMJrn8uCq52XYvAEorNkLrUdoawg@mail.gmail.com
This commit is contained in:
39
src/include/partitioning/partdesc.h
Normal file
39
src/include/partitioning/partdesc.h
Normal file
@ -0,0 +1,39 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* partdesc.h
|
||||
*
|
||||
* Copyright (c) 1996-2018, PostgreSQL Global Development Group
|
||||
*
|
||||
* src/include/utils/partdesc.h
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef PARTDESC_H
|
||||
#define PARTDESC_H
|
||||
|
||||
#include "partitioning/partdefs.h"
|
||||
#include "utils/relcache.h"
|
||||
|
||||
/*
|
||||
* Information about partitions of a partitioned table.
|
||||
*/
|
||||
typedef struct PartitionDescData
|
||||
{
|
||||
int nparts; /* Number of partitions */
|
||||
Oid *oids; /* Array of 'nparts' elements containing
|
||||
* partition OIDs in order of the their bounds */
|
||||
bool *is_leaf; /* Array of 'nparts' elements storing whether
|
||||
* the corresponding 'oids' element belongs to
|
||||
* a leaf partition or not */
|
||||
PartitionBoundInfo boundinfo; /* collection of partition bounds */
|
||||
} PartitionDescData;
|
||||
|
||||
extern void RelationBuildPartitionDesc(Relation rel);
|
||||
|
||||
extern Oid get_default_oid_from_partdesc(PartitionDesc partdesc);
|
||||
|
||||
extern bool equalPartitionDescs(PartitionKey key, PartitionDesc partdesc1,
|
||||
PartitionDesc partdesc2);
|
||||
|
||||
#endif /* PARTCACHE_H */
|
Reference in New Issue
Block a user