Re: [HACKERS] GSoC 2017: Foreign Key Arrays

Поиск
Список
Период
Сортировка
От Joel Jacobson
Тема Re: [HACKERS] GSoC 2017: Foreign Key Arrays
Дата
Msg-id d3f9279f-ed12-4ee9-81ff-8e30d4ebc1e1@www.fastmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] GSoC 2017: Foreign Key Arrays  (Mark Rofail <markm.rofail@gmail.com>)
Ответы Re: [HACKERS] GSoC 2017: Foreign Key Arrays  (Mark Rofail <markm.rofail@gmail.com>)
Список pgsql-hackers
On Tue, Jan 26, 2021, at 12:59, Mark Rofail wrote:
> Please don't hesitate to give your feedback.

The error message for insert or update violations looks fine:

UPDATE catalog_clone.pg_extension SET extconfig = ARRAY[12345] WHERE oid = 10;
ERROR:  insert or update on table "pg_extension" violates foreign key constraint "pg_extension_extconfig_fkey"
DETAIL:  Key (EACH ELEMENT OF extconfig)=(12345) is not present in table "pg_class".

But when trying to delete a still referenced row,
the column mentioned in the "EACH ELEMENT OF" sentence
is not the array column, but the column in the referenced table:

DELETE FROM catalog_clone.pg_class WHERE oid = 10;
ERROR:  update or delete on table "pg_class" violates foreign key constraint "pg_extension_extconfig_fkey" on table "pg_extension"
DETAIL:  Key (EACH ELEMENT OF oid)=(10) is still referenced from table "pg_extension".

I think either the "EACH ELEMENT OF" part of the latter error message should be dropped,
or the column name for the array column should be used.

/Joel

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

Предыдущее
От: Sehrope Sarkuni
Дата:
Сообщение: Re: Add SQL function for SHA1
Следующее
От: "Hou, Zhijie"
Дата:
Сообщение: RE: Parallel INSERT (INTO ... SELECT ...)