handling multiple matching constraints in DetachPartitionFinalize()

Поиск
Список
Период
Сортировка
Искать
От
Zhihong Yu
Тема
handling multiple matching constraints in DetachPartitionFinalize()
Дата
Msg-id
CALNJ-vT-RfQeScWi3iQWPzwHgGnH=9X9kADPK5yQEFfeGn+AKw@mail.gmail.com
Список
Дерево обсуждения
handling multiple matching constraints in DetachPartitionFinalize() Zhihong Yu <zyu@yugabyte.com>
Re: handling multiple matching constraints in DetachPartitionFinalize() Zhihong Yu <zyu@yugabyte.com>
Re: handling multiple matching constraints in DetachPartitionFinalize() Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: handling multiple matching constraints in DetachPartitionFinalize() Zhihong Yu <zyu@yugabyte.com>
Re: handling multiple matching constraints in DetachPartitionFinalize() Alvaro Herrera <alvherre@alvh.no-ip.org>
Hi,
I was looking at the following code in DetachPartitionFinalize():

        /* If there's a constraint associated with the index, detach it too */
        constrOid = get_relation_idx_constraint_oid(RelationGetRelid(partRel),
                                                    idxid);

As mentioned in email thread `parenting a PK constraint to a self-FK one`, there may be multiple matching constraints, I think we should call ConstraintSetParentConstraint() for each of them.

This means adding a helper method similar to get_relation_idx_constraint_oid() which finds constraint and calls ConstraintSetParentConstraint().

I am preparing a patch.
Please let me know if my proposal makes sense.

Thanks
В списке pgsql-hackers по дате отправления
От: Jacob Champion
Дата:
От: Nathan Bossart
Дата:
FAQ