Hi https://www.postgresql.org/message-id/aPBoXXW3XuwiIsHG%40paquier.xyz
Based on previous discussions, we had configured DROP/ALTER DATABASE to terminate only background workers with specific parameters set. To reconsider the default behavior, I created the following patches: 0001 is the patch for the existing implementation. 0002 is the patch modified based on Pavel-san's suggestion. The 0002 patch changes the default behavior to terminate background workers when DROP/ALTER DATABASE is executed. It also includes a test set for this change. For background workers that should not be terminated, setting the BGWORKER_PROTECTED parameter prevents this. The relationship with the FORCE option during DROP DATABASE is as follows: FORCE option present, flag present... TERMINATE FORCE option present, flag absent... TERMINATE FORCE option absent, flag present... Does not TERMINATE due to the flag FORCE option absent, flag absent... TERMINATE I would like to know your comments on which implementation is preferable. Regards, Aya Iwata
v0011-0001-Allow-background-workers-to-be-terminated.patch
Description: v0011-0001-Allow-background-workers-to-be-terminated.patch
v0011-0002-Renamed-the-flag-to-BGWORKER_PROTECTED.patch
Description: v0011-0002-Renamed-the-flag-to-BGWORKER_PROTECTED.patch
