Re: partitioning question -- how to guarantee uniqueness across partitions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: partitioning question -- how to guarantee uniqueness across partitions
Дата
Msg-id 10405.1246210055@sss.pgh.pa.us
обсуждение исходный текст
Ответ на partitioning question -- how to guarantee uniqueness across partitions  (Whit Armstrong <armstrong.whit@gmail.com>)
Ответы Re: partitioning question -- how to guarantee uniqueness across partitions  (Whit Armstrong <armstrong.whit@gmail.com>)
Список pgsql-general
Whit Armstrong <armstrong.whit@gmail.com> writes:
> I have a simple example copied from the 8.3 manual on partitioning
> (http://www.postgresql.org/docs/8.3/interactive/ddl-partitioning.html).

> My question is, if you create a serial type in the parent table which
> is meant to be the primary key across all the partitions, how does one
> guarantee uniqueness of that key?

One doesn't.  That is not an appropriate way to set up a partitioned
table.  You need a primary key that can actually be used as a meaningful
partitioning key.  In this example, the id is completely useless and
what you should be looking at is making the data_value be the primary
key.

            regards, tom lane

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

Предыдущее
От: Justin
Дата:
Сообщение: Re: Switching from MySQL: ON DUPLICATE KEY UPDATE, plpgsql function
Следующее
От: Whit Armstrong
Дата:
Сообщение: Re: partitioning question -- how to guarantee uniqueness across partitions