public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Euler Taveira <[email protected]>
Cc: [email protected] <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: relcache not invalidated when ADD PRIMARY KEY USING INDEX
Date: Sat, 22 Jan 2022 13:38:04 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <OS0PR01MB5716EBE01F112C62F8F9B786947B9@OS0PR01MB5716.jpnprd01.prod.outlook.com>
<[email protected]>
"Euler Taveira" <[email protected]> writes:
> On Mon, Dec 20, 2021, at 3:45 AM, [email protected] wrote:
>> 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.
Indeed.
> It seems you can simplify your checking indexForm->indisprimary directly, no?
The logic seems fine to me --- it avoids an unnecessary cache flush
if the index was already the pkey. (Whether we actually reach this
code in such a case, I dunno, but it's not costing much to be smart
if we are.)
> 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?
I agree, the proposed test cases are expensive overkill. The repro
shown in the original message is sufficient and much cheaper.
Moreover, we already have some test cases very much like that in
regress/sql/publication.sql, so that's where I put it.
Pushed with some minor cosmetic adjustments.
regards, tom lane
view thread (2+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: relcache not invalidated when ADD PRIMARY KEY USING INDEX
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox