Re: PATCH: Add REINDEX tag to event triggers

Поиск
Список
Период
Сортировка
От jian he
Тема Re: PATCH: Add REINDEX tag to event triggers
Дата
Msg-id CACJufxErztdYqGnN5WPfG6PX+WL3hX9DaP2_9Z4sp--cEmWy-w@mail.gmail.com
обсуждение исходный текст
Ответ на PATCH: Add REINDEX tag to event triggers  (Garrett Thornburg <film42@gmail.com>)
Ответы Re: PATCH: Add REINDEX tag to event triggers  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On Fri, Jul 21, 2023 at 12:47 PM Garrett Thornburg <film42@gmail.com> wrote:
>
> Added my v1 patch to add REINDEX to event triggers.
>
> I originally built this against pg15 but rebased to master for the patch to hopefully make it easier for maintainers
tomerge. The rebase was automatic so it should be easy to include into any recent version. I'd love for this to land in
pg16if possible. 
>
> I added regression tests and they are passing. I also formatted the code using the project tools. Docs are included
too.
>
> A few notes:
> 1. I tried to not touch the function parameters too much and opted to create a convenience function that makes it
easyto attach index or table OIDs to the current event trigger list. 
> 2. I made sure both concurrent and regular reindex of index, table, database work as expected.
> 3. The ddl end command will make available all indexes that were modified by the reindex command. This is a large
listwhen you run "reindex database" but works really well. I debated returning records of the table or DB that were
reindexedbut that doesn't really make sense. Returning each index fits my use case of building an audit record around
theindex lifecycle (hence the motivation for the patch). 
>
> Thanks for your time,
>
> Garrett Thornburg


main/postgres/src/backend/tcop/utility.c
535: /*
536:  * standard_ProcessUtility itself deals only with utility commands for
537:  * which we do not provide event trigger support.  Commands that do have
538:  * such support are passed down to ProcessUtilitySlow, which contains the
539:  * necessary infrastructure for such triggers.
540:  *
541:  * This division is not just for performance: it's critical that the
542:  * event trigger code not be invoked when doing START TRANSACTION for
543:  * example, because we might need to refresh the event trigger cache,
544:  * which requires being in a valid transaction.
545:  */

so  T_ReindexStmt should only be in  ProcessUtilitySlow, if you want
to create an event trigger on reindex?

regression tests work fine. I even play with partitions.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Anton A. Melnikov"
Дата:
Сообщение: Re: [BUG] Crash on pgbench initialization.
Следующее
От: Amit Kapila
Дата:
Сообщение: Logical walsenders don't process XLOG_CHECKPOINT_SHUTDOWN