mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-08 01:37:32 +08:00
If we restrict unique constraints on partitioned tables so that they must always include the partition key, then our standard approach to unique indexes already works --- each unique key is forced to exist within a single partition, so enforcing the unique restriction in each index individually is enough to have it enforced globally. Therefore we can implement unique indexes on partitions by simply removing a few restrictions (and adding others.) Discussion: https://postgr.es/m/20171222212921.hi6hg6pem2w2t36z@alvherre.pgsql Discussion: https://postgr.es/m/20171229230607.3iib6b62fn3uaf47@alvherre.pgsql Reviewed-by: Simon Riggs, Jesper Pedersen, Peter Eisentraut, Jaime Casanova, Amit Langote
36 lines
1.3 KiB
C
36 lines
1.3 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* parse_utilcmd.h
|
|
* parse analysis for utility commands
|
|
*
|
|
*
|
|
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* src/include/parser/parse_utilcmd.h
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef PARSE_UTILCMD_H
|
|
#define PARSE_UTILCMD_H
|
|
|
|
#include "parser/parse_node.h"
|
|
|
|
|
|
extern List *transformCreateStmt(CreateStmt *stmt, const char *queryString);
|
|
extern List *transformAlterTableStmt(Oid relid, AlterTableStmt *stmt,
|
|
const char *queryString);
|
|
extern IndexStmt *transformIndexStmt(Oid relid, IndexStmt *stmt,
|
|
const char *queryString);
|
|
extern void transformRuleStmt(RuleStmt *stmt, const char *queryString,
|
|
List **actions, Node **whereClause);
|
|
extern List *transformCreateSchemaStmt(CreateSchemaStmt *stmt);
|
|
extern PartitionBoundSpec *transformPartitionBound(ParseState *pstate, Relation parent,
|
|
PartitionBoundSpec *spec);
|
|
extern IndexStmt *generateClonedIndexStmt(RangeVar *heapRel, Oid heapOid,
|
|
Relation source_idx,
|
|
const AttrNumber *attmap, int attmap_length,
|
|
Oid *constraintOid);
|
|
|
|
#endif /* PARSE_UTILCMD_H */
|