Re: BUG #18016: REINDEX TABLE failure
Gurjeet Singh <gurjeet@singh.im>
From: Gurjeet Singh <gurjeet@singh.im>
To: Tom Lane <tgl@sss.pgh.pa.us>,
Postgres Hackers <pgsql-hackers@postgresql.org>
Cc: Michael Paquier <michael@paquier.xyz>, richard.vesely@softea.sk, pgsql-bugs@lists.postgresql.org
Date: 2023-07-10T16:35:05Z
Lists: pgsql-bugs, pgsql-hackers
Attachments
- v1-0001-Reindex-toast-table-s-index-before-main-table-s-i.patch (application/octet-stream) patch v1-0001
On Sun, Jul 9, 2023 at 7:18 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > > Michael Paquier <michael@paquier.xyz> writes: > > That should be OK, I assume. However, if this is improved and > > something we want to support in the long-run I guess that a TAP test > > may be appropriate. > > I do not see the point of a TAP test. It's not like the code isn't > covered perfectly well. Please find attached the patch that makes REINDEX TABLE perform reindex on toast table before reindexing the main table's indexes. The code block movement involved slightly more thought and care than I had previously imagined. As explained in comments in the patch, the enumeration and suppression of indexes on the main table must happen before any CommandCounterIncrement() call, hence the reindex-the-toast-table-if-any code had to be placed after that enumeration. In support of the argument above, the patch does not include any TAP tests. Reliably reproducing the original error message involves restarting the database, and since that can't be done via SQL commands, no sql tests are included, either. The patch also includes minor wordsmithing, and benign whitespace changes in neighboring code. Best regards, Gurjeet http://Gurje.et
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Reindex toast before its main relation in reindex_relation()
- f2bf8fb04886 17.0 landed
-
Fix comment in index.c
- bd5760df38c0 17.0 landed
-
Clean up a bug in sql/json items commit 66ea94e8e6
- 06a66d87dbc7 17.0 cited
-
Create a "relation mapping" infrastructure to support changing the relfilenodes
- b9b8831ad60f 9.0.0 cited