Re: Creating a partition table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Creating a partition table
Дата
Msg-id 101520.1604081342@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Creating a partition table  (John Scalia <jayknowsunix@gmail.com>)
Список pgsql-admin
John Scalia <jayknowsunix@gmail.com> writes:
> Ok I tried what Laurent had suggested and now the error is:
> Insufficient columns in PRIMARY KEY constraint definition.

> Now, the attribute the devs want is not a key value in the original table, but if it were that wouldn’t make a great
dealof sense for a partition. So, now why did it gripe? 

FWIW, we recently rephrased that message as "unique constraint on
partitioned table must include all partitioning columns", because
people were finding it confusing.

The reason for the restriction is that a partitioned index is really
just a collection of separate indexes on the individual leaf partitions
(just as the partitioned table is a collection of plain tables).
So it can't enforce uniqueness across partitions unless such uniqueness
is guaranteed by the partitioning scheme.

Yeah, this is an implementation restriction, but I don't foresee it
ever going away.  If the indexes weren't independent then you'd lose
the scalability benefits that partitioning is meant to provide.

            regards, tom lane



В списке pgsql-admin по дате отправления:

Предыдущее
От: John Scalia
Дата:
Сообщение: Re: Creating a partition table
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: free(): invalid pointer , when to dumping data to a new server