| From: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
|---|---|
| To: | Antonin Houska <ah(at)cybertec(dot)at> |
| Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
| Subject: | Re: repack: fix a bug to reject deferrable primary key fallback for concurrent mode |
| Date: | 2026-04-26 07:35:59 |
| Message-ID: | 5FD0FDC6-EE6C-4368-8B1E-7A6F4917254F@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
> On Apr 21, 2026, at 14:09, Antonin Houska <ah(at)cybertec(dot)at> wrote:
>
> Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>
>>> On Apr 20, 2026, at 22:52, Antonin Houska <ah(at)cybertec(dot)at> wrote:
>>>
>>> I'm just thinking if it's worth a separate error message.
>>> RelationGetIndexList() just ignores the deferrable PK
>>>
>>> if (replident == REPLICA_IDENTITY_DEFAULT && OidIsValid(pkeyIndex) && !pkdeferrable)
>>> relation->rd_replidindex = pkeyIndex;
>>>
>>> and if there's no other suitable index, the result is that there is no
>>> identity index for the table. So the change attached here should be consistent
>>> with this approach.
>
>> Thanks for your review. I guess you read the v1 patch. In v2, I have switched to use GetRelationIdentityOrPK() that Zhijie suggested, which has covered RelationGetIndexList() and all checks, so that code is simplified, and there is no longer a separate error message.
>
> Yes, this looks like the best approach. Sorry for missing v2.
>
Thanks for your reviewing and confirming.
Rebased to v4 as the CF reported a conflict.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
| Attachment | Content-Type | Size |
|---|---|---|
| v4-0001-Reject-deferrable-primary-key-fallback-in-REPACK-.patch | application/octet-stream | 7.7 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Mihail Nikalayeu | 2026-04-26 13:34:00 | Re: Adding REPACK [concurrently] |
| Previous Message | Chao Li | 2026-04-26 07:21:14 | Re: Property graph: fix error handling when dropping non-existent label property |