Re: On partitioning, PKs and FKs
| От | David G. Johnston |
|---|---|
| Тема | Re: On partitioning, PKs and FKs |
| Дата | |
| Msg-id | CAKFQuwbFHwNvkgL+W4rtk96CzHF5hQd2e4+TN3B3AvxM=dc5hQ@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: On partitioning, PKs and FKs (Wiwwo Staff <wiwwo@wiwwo.com>) |
| Список | pgsql-general |
On Thursday, July 8, 2021, Wiwwo Staff <wiwwo@wiwwo.com> wrote:
On Thu, 8 Jul 2021 at 21:42, Alban Hertroys <alban.hertroys@apollotyres.com> wrote: On 2021-07-08 13:30, Ron wrote:
> Thus, the bigTable PK must be on id, columnX, (No, I don't like it
> either.)
That's not entirely true. You can keep the PK on id if you additionally
create a unique constraint on (id, columnX).
Uhm, but that means that i have to partition by id and columnX, which is not what I really want...
Those examples show that Alban’s comment that you can keep the PK on id is incorrect.
All you can do is ensure that a given non-partition value is unique on any given partition. You cannot setup a constraint that definitionally requires the entire partition tree to coordinate and ensure none of the partitions have duplicates among them.
David J.
В списке pgsql-general по дате отправления: