Re: Fix foreign key constraint check for partitioned tables

Поиск
Список
Период
Сортировка
От Hadi Moshayedi
Тема Re: Fix foreign key constraint check for partitioned tables
Дата
Msg-id CAK=1=WonwcuN_0KiZwQO3SQxse41jZ5hOJRpFCvZ3qa8n9cssw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Fix foreign key constraint check for partitioned tables  (Edmund Horner <ejrh00@gmail.com>)
Ответы Re: Fix foreign key constraint check for partitioned tables
Список pgsql-hackers
Hello Edmund,

Thanks for the review.
 
I was a bit curious about the need for "set role" in the reproduction,
but I see that it's because RI_Initial_Check does some checks to see
if a simple SELECT can be used, and one of the checks is for basic
table permissions.

I think to reproduce this the current user shouldn't be able to SELECT on both tables, so RI_Initial_Check fails. Setting the owner of one of the tables isn't always enough as the current user can be a super user.
  
I wonder if the macro RELKIND_HAS_STORAGE should be used instead of
checking for each relkind?  This would apply to the check on line 4405
too.

done.

This patch also changed the output of some of tests, i.e. previously foreign key constraint failures errored on the partitioned table itself, but now it shows the child table's name in the error message. I hope it is ok.

I also added a regression test which would fail without this patch.

Thanks,
Hadi
 
Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: warning to publication created and wal_level is not set to logical
Следующее
От: Erik Rijkers
Дата:
Сообщение: Re: [HACKERS] proposal: schema variables