Re: BUG #16706: insert into on conflict(pk) do update error violates not-null constraint

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #16706: insert into on conflict(pk) do update error violates not-null constraint
Дата
Msg-id 1974489.1604935011@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #16706: insert into on conflict(pk) do update error violates not-null constraint  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #16706: insert into on conflict(pk) do update error violates not-null constraint  (Vik Fearing <vik@postgresfriends.org>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> example:
> CREATE TABLE TEST1 (
>     id varchar(100) NOT NULL,
>     name varchar(100) NOT NULL,
>     status varchar(100) NOT NULL,
>     CONSTRAINT test1_pkey PRIMARY KEY (id)
> )

> insert into TEST1 (ID, NAME,STATUS ) values('4','test','6') ;
> insert into TEST1 as t1 (ID, NAME,STATUS ) values('4',null,'6') on conflict
> (id) do update set NAME=COALESCE(excluded.NAME,t1.NAME),
> STATUS=COALESCE(excluded.STATUS,t1.STATUS);

I get

ERROR:  null value in column "name" violates not-null constraint
DETAIL:  Failing row contains (4, null, 6).

so this seems to have been fixed already.

            regards, tom lane



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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Re: BUG #16702: inline code and function : when use dynamic name for rowtype, there is some bug!
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Re: BUG #16702: inline code and function : when use dynamic name for rowtype, there is some bug!