Re: Corruption with duplicate primary key

Поиск
Список
Период
Сортировка
От Alex Adriaanse
Тема Re: Corruption with duplicate primary key
Дата
Msg-id SN6PR03MB3598F20EE858DA6FD71EB75AA95A0@SN6PR03MB3598.namprd03.prod.outlook.com
обсуждение исходный текст
Ответ на Re: Corruption with duplicate primary key  ("Finnerty, Jim" <jfinnert@amazon.com>)
Список pgsql-hackers
On Mon, December 9, 2019 at 11:05 AM Finnerty, Jim wrote:
> If you have BEFORE triggers, and a BEFORE trigger signaled failure with RETURN NULL, then this is one known (and
documented)issue that I think could cause the behavior you're reporting: 
>    
>
https://www.postgresql-archive.org/BEFORE-triggers-that-return-NULL-can-circumvent-referential-integrity-tt6056390.html#none
>
> It's hard to say if this is the cause or not, but if you have any BEFORE triggers that RETURN NULL, you might want to
reviewthe documentation very carefully. 

We do have a BEFORE INSERT trigger, but it should never return NULL. This trigger INSERTs into a different table using
anON CONFLICT DO NOTHING clause and then does a RETURN NEW. 

Alex


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

Предыдущее
От: Alex Adriaanse
Дата:
Сообщение: Re: Corruption with duplicate primary key
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Runtime pruning problem