Re: [BUG]Invalidate relcache when setting REPLICA IDENTITY - Mailing list pgsql-hackers

From Euler Taveira
Subject Re: [BUG]Invalidate relcache when setting REPLICA IDENTITY
Date
Msg-id 0fe01530-78b1-4cbf-8af8-99f01667fe5e@www.fastmail.com
Whole thread Raw
In response to RE: [BUG]Invalidate relcache when setting REPLICA IDENTITY  ("houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>)
Responses RE: [BUG]Invalidate relcache when setting REPLICA IDENTITY
List pgsql-hackers
On Thu, Nov 11, 2021, at 9:01 AM, houzj.fnst@fujitsu.com wrote:
Also attach the patches for back branch and remove some unnecessary
changes from pgindent.
I reviewed your patch and I think the fix could be simplified by

if (OidIsValid(indexOid))
CacheInvalidateRelcache(rel);

If indexOid is valid it is a REPLICA IDENTITY INDEX. A few lines above there is
a check for a valid indexOid that makes sure the index is already marked as a
replica identity; if so, it bail out. If it is not, the relation should be
invalidated. Am I missing something?

I also modified your test case to include a DELETE command, wait the initial
table sync to avoid failing a subsequent test and improve some comments.


--
Euler Taveira

Attachment

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Should AT TIME ZONE be volatile?
Next
From: Tom Lane
Date:
Subject: Re: simplifying foreign key/RI checks