Re: relcache not invalidated when ADD PRIMARY KEY USING INDEX

Euler Taveira <euler@eulerto.com>

From: "Euler Taveira" <euler@eulerto.com>
To: "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-12-20T22:28:30Z
Lists: pgsql-hackers
On Mon, Dec 20, 2021, at 3:45 AM, houzj.fnst@fujitsu.com wrote:
> Hi,
> 
> When reviewing some replica identity related patches, I found that when adding
> primary key using an existing unique index on not null columns, the
> target table's relcache won't be invalidated.
Good catch.

It seems you can simplify your checking indexForm->indisprimary directly, no?

Why did you add new tests for test_decoding? I think the TAP tests alone are
fine. BTW, this test is similar to publisher3/subscriber3. Isn't it better to
use the same pub/sub to reduce the test execution time?


--
Euler Taveira
EDB   https://www.enterprisedb.com/

Commits

  1. Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING INDEX.