Re: PATCH: Add REINDEX tag to event triggers

Jim Jones <jim.jones@uni-muenster.de>

From: Jim Jones <jim.jones@uni-muenster.de>
To: jian he <jian.universality@gmail.com>
Cc: Garrett Thornburg <film42@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2023-09-04T18:00:52Z
Lists: pgsql-hackers
On 01.09.23 18:10, jian he wrote:
> Thanks for pointing this out! 
Thanks for the fix!
> also due to commit
> https://git.postgresql.org/cgit/postgresql.git/commit/?id=11af63fb48d278b86aa948a5b57f136ef03c2bb7
> ExecReindex function input arguments also changed. so we need to
> rebase this patch.
>
> change to
> currentReindexStatement = unconstify(ReindexStmt*, stmt);
> seems to work for me. I tested it, no warning. But I am not 100% sure.
>
> anyway I refactored the patch, making it git applyable
> also change from "currentReindexStatement = stmt;" to
> "currentReindexStatement = unconstify(ReindexStmt*, stmt);" due to
> ExecReindex function changes.

LGTM. It applies and builds cleanly, all tests pass and documentation 
also builds ok. The CFbot seems also much happier now :)

I tried this "small stress test" to see if the code was leaking .. but 
it all looks ok to me:

DO $$
BEGIN
   FOR i IN 1..10000 LOOP
     REINDEX INDEX reindex_test.reindex_test1_idx1;
     REINDEX TABLE reindex_test.reindex_tester1;
   END LOOP;
END;
$$;


Jim




Commits

  1. Fix assertion failure with REINDEX and event triggers

  2. Add support for REINDEX in event triggers

  3. Doc: Improve documentation for creating custom scan paths.

  4. Add const decorations