Re: partial "on-delete set null" constraint

Поиск
Список
Период
Сортировка
От Melvin Davidson
Тема Re: partial "on-delete set null" constraint
Дата
Msg-id CANu8FixXcGPMtSopD7RoQw9AKDGWyj3L79bayu5fUCwTXDNjPg@mail.gmail.com
обсуждение исходный текст
Ответ на partial "on-delete set null" constraint  (Rafal Pietrak <rafal@ztk-rp.eu>)
Список pgsql-general
Your main problem is that column "domain" of mailboxes is specified as NOT NULL, so of course the "SET NULL" option will not work.

Here is the full message I see when I execute your code, which should
be self explanatory.

ERROR:  null value in column "domain" violates not-null constraint
DETAIL:  Failing row contains (null, null, Hello).
CONTEXT:  SQL statement "UPDATE ONLY "public"."mailboxes" SET "username" = NULL, "domain" = NULL WHERE $1 OPERATOR(pg_catalog.=) "username" AND $2 OPERATOR(pg_catalog.=) "domain""
********** Error **********

ERROR: null value in column "domain" violates not-null constraint
SQL state: 23502
Detail: Failing row contains (null, null, Hello).
Context: SQL statement "UPDATE ONLY "public"."mailboxes" SET "username" = NULL, "domain" = NULL WHERE $1 OPERATOR(pg_catalog.=) "username" AND $2 OPERATOR(pg_catalog.=) "domain""

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

Предыдущее
От: Rafal Pietrak
Дата:
Сообщение: partial "on-delete set null" constraint
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: partial "on-delete set null" constraint