Новые сообщения [новые:0]
Дайджест
Горячие темы
Избранное [новые:0]
Форумы
Пользователи
Статистика
Статистика нагрузки
Мод. лог
Поиск
|
13.09.2021, 18:26
|
|||
---|---|---|---|
|
|||
Вопрос по секционированию |
|||
#18+
Есть таблица с полями id, val. Можно ли ее как-нибудь секционировать по Range (id), но при этом сделать val уникальным в пределах всей таблицы? У меня все время ругается "В ограничении UNIQUE таблицы "test" не хватает столбца "id", входящего в ключ секционирования." ... |
|||
:
Нравится:
Не нравится:
|
|||
|
13.09.2021, 19:08
|
|||
---|---|---|---|
|
|||
Вопрос по секционированию |
|||
#18+
Pitrovich Есть таблица с полями id, val. Можно ли ее как-нибудь секционировать по Range (id), но при этом сделать val уникальным в пределах всей таблицы? У меня все время ругается "В ограничении UNIQUE таблицы "test" не хватает столбца "id", входящего в ключ секционирования." Нельзя. Unique constraints (and hence primary keys) on partitioned tables must include all the partition key columns. This limitation exists because the individual indexes making up the constraint can only directly enforce uniqueness within their own partitions; therefore, the partition structure itself must guarantee that there are not duplicates in different partitions. There is no way to create an exclusion constraint spanning the whole partitioned table. It is only possible to put such a constraint on each leaf partition individually. Again, this limitation stems from not being able to enforce cross-partition restrictions. https://www.postgresql.org/docs/13/ddl-partitioning.html -- Maxim Boguk лучшая поддержка PostgreSQL: dataegret.ru ... |
|||
:
Нравится:
Не нравится:
|
|||
|
|
start [/forum/topic.php?fid=53&mobile=1&tid=1993865]: |
0ms |
get settings: |
10ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
28ms |
get topic data: |
11ms |
get forum data: |
2ms |
get page messages: |
38ms |
get tp. blocked users: |
1ms |
others: | 12ms |
total: | 124ms |
0 / 0 |