Re: Is there a work around for partition key needed for constraint

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

 





On Wed, Oct 24, 2018, 6:11 PM Jorge Torralba <jorge.torralba@xxxxxxxxx> wrote:
Wow, thats a convoluted solution and I don't know if it will allow the use of upsert. I hope this solution is in the works :(



I have a workaround for this in pg_partman. It uses a template table to apply the unique indexes to the child tables. Note that it doesn't enforce the unique constraint across all the child tables, only each child table. Since you're doing ON CONFLICT DO NOTHING, this may work ok for your situation tho. I don't think it would work if you needed it to move the rows between partitions on conflict tho, unless the constraint was part of the partition key. 

The real solution will have to wait on a global index in a future version. 

https://github.com/pgpartman/pg_partman

Keith



On Wed, Oct 24, 2018 at 12:05 PM legrand legrand <legrand_legrand@xxxxxxxxxxx> wrote:
Hi
something similar is already discussed here:

https://www.postgresql-archive.org/PostgreSQL-11-global-index-td6032681.html

Regards
PAscal



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-admin-f2076596.html



--
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