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

Поиск
Список
Период
Сортировка
От Keith Fiske
Тема Re: Is there a work around for partition key needed for constraint
Дата
Msg-id CAODZiv7+Hf+b+W0Q34=j1W6HwbAOkxzxGoc5HDS9HB8OVva65w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Is there a work around for partition key needed for constraint  (Jorge Torralba <jorge.torralba@gmail.com>)
Ответы Re: Is there a work around for partition key needed for constraint
Список pgsql-admin


On Wed, Oct 24, 2018, 6:11 PM Jorge Torralba <jorge.torralba@gmail.com> 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. 


Keith



On Wed, Oct 24, 2018 at 12:05 PM legrand legrand <legrand_legrand@hotmail.com> 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.

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

Предыдущее
От: Jorge Torralba
Дата:
Сообщение: Re: Is there a work around for partition key needed for constraint
Следующее
От: Evan Bauer
Дата:
Сообщение: Re: Encryption / Decryption via PGCrypto