Re: Auto creation of Partitions - Mailing list pgsql-hackers

From Zeugswetter Andreas ADI SD
Subject Re: Auto creation of Partitions
Date
Msg-id E1539E0ED7043848906A8FF995BDA57901D42CF3@m0143.s-mxs.net
Whole thread Raw
In response to Re: Auto creation of Partitions  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Auto creation of Partitions  (NikhilS <nikkhils@gmail.com>)
List pgsql-hackers
> > iv) Based on the PRIMARY, UNIQUE, REFERENCES information specified,
> > pass it on to the children tables.
>
> How will you maintain a primary key in such a table,
> considering that indexes can't span multiple tables?

Many partitioning schemes have (or can be made to have) only one
possible target partition for the primary key. Thus if you create
separate unique indexes on each partition the problem is solved.
For a first version I opt, that it is sufficient to disallow creation of
a unique index on the master, when the constraints (on columns of this
index) do not nail down a specific partition for each row (e.g. a hash
or a range on one of the index columns that does not overlap).
Later, global index, or indexes with separate partitioning rules can be
implemented, that cover the other cases.

Andreas


pgsql-hackers by date:

Previous
From: Grzegorz Jaskiewicz
Date:
Subject: Re: Grouped Index Tuples / Clustered Indexes
Next
From: "Luke Lonergan"
Date:
Subject: Re: Grouped Index Tuples / Clustered Indexes