Is there a work around for partition key needed for constraint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux