Re: [BUGS] 10.0: Logical replication doesn't execute BEFORE UPDATEOF trigger

Поиск
Список
Период
Сортировка
От Aleksander Alekseev
Тема Re: [BUGS] 10.0: Logical replication doesn't execute BEFORE UPDATEOF trigger
Дата
Msg-id 20171010102613.GA28161@e733.localdomain
обсуждение исходный текст
Ответ на Re: [BUGS] 10.0: Logical replication doesn't execute BEFORE UPDATE OF trigger  (Masahiko Sawada <sawada.mshk@gmail.com>)
Список pgsql-bugs
Hi Masahiko,

> > I think the cause of this issue is that the apply worker doesn't set
> > updatedCols of RangeTblEntry when applying updates. So TriggerEnabled
> > always ends up with false. I'll make a patch and submit.
> >
>
> Attached patch store the updated columns bitmap set to RangeTblEntry.
> In my environment this bug seems to be fixed by the patch.

Thanks a lot for a quick response. I can confirm that your patch fixes
the issue and passes all tests. Hopefully someone will merge it shortly.

Here is another patch from me. It adds a corresponding TAP test. Before
applying your patch:

```
t/001_rep_changes.pl .. ok
t/002_types.pl ........ ok
t/003_constraints.pl .. 1/5
#   Failed test 'check replica trigger with specified list of affected columns applied on subscriber'
#   at t/003_constraints.pl line 151.
#          got: 'k2|v1'
#     expected: 'k2|v1
# triggered|true'
# Looks like you failed 1 test of 5.
t/003_constraints.pl .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/5 subtests
t/004_sync.pl ......... ok
t/005_encoding.pl ..... ok
t/006_rewrite.pl ...... ok
t/007_ddl.pl .......... ok
```

After:

```
t/001_rep_changes.pl .. ok
t/002_types.pl ........ ok
t/003_constraints.pl .. ok
t/004_sync.pl ......... ok
t/005_encoding.pl ..... ok
t/006_rewrite.pl ...... ok
t/007_ddl.pl .......... ok
All tests successful.
```

--
Best regards,
Aleksander Alekseev

Вложения

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

Предыдущее
От: Josef Machytka
Дата:
Сообщение: Re: [BUGS] BUG #14845: postgres_fdw and mysql_fdw can cause crash of instance
Следующее
От: Giovanni Pisante | Danysoft
Дата:
Сообщение: Re: [BUGS] please quote POSTGRESQL