Is there a work around for partition key needed for constraint

Поиск
Список
Период
Сортировка
От Jorge Torralba
Тема Is there a work around for partition key needed for constraint
Дата
Msg-id CACut7uTMN=E-OK+gdvUU3BMn+O+OAbA9nd3R=W9wLfnvv2TaHg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Is there a work around for partition key needed for constraint
Список pgsql-admin
Working with postgres 11 now and trying to use declarative partition for its benefits and ability to update data and move to the proper partition. However, I am running into an issue with the limitation of having to include the partition key as part of the unique constraint.

For example,

I have a table, call it xxx with

account_id, customer_id, date_added and so on ...._

partitioned by range on the date_added.

then a bunch of partition tables with a range.

I want to be able to use insert into xxx on conflict ( account_id, customer_id ) do nothing.

However, since the requirements for a unique index on a partitioned table  must include the partition key of date_added, I am kind of stuck. 

Is there anyway to create a unique constraint on a partitioned table without using the column it is partitioned  by ?

Thanks

--
Thanks,

Jorge Torralba
----------------------------

Note: This communication may contain privileged or other confidential information. If you are not the intended recipient, please do not print, copy, retransmit, disseminate or otherwise use the information. Please indicate to the sender that you have received this email in error and delete the copy you received. Thank You.

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

Предыдущее
От: ZongtianHou
Дата:
Сообщение: Re: Can I add a column in catalog table as a superuser
Следующее
От: legrand legrand
Дата:
Сообщение: Re: Is there a work around for partition key needed for constraint