Acquire ACCESS EXCLUSIVE lock on repack_drop() when trigger exists#473
Acquire ACCESS EXCLUSIVE lock on repack_drop() when trigger exists#473
ACCESS EXCLUSIVE lock on repack_drop() when trigger exists#473Conversation
repack_swap() already drops the trigger repack_trigger and repack_drop() doesn't need to drop it if repack_swap() finished successfully. If repack_drop() doesn't need to drop the trigger it also doesn't need to acquire ACCESS EXCLUSIVE lock which might be beneficial on write heavy tables.
|
I didn't even know we were trying to remove the trigger twice... |
Yeah, I'm not sure what was the purpose of |
|
I thought that the counter was needed for older versions of postgresql, when there was no IF EXISTS expression yet. But it turns out the counter isn't that old. It doesn't seem particularly necessary, but it's really not the subject of this PR. LGTM |
|
From the commit message:
It seems the motivation is to avoid error messages. AFAIK
+1 |
repack_swap()already drops the triggerrepack_triggerandrepack_drop()doesn't need to drop it ifrepack_swap()finished successfully. Ifrepack_drop()doesn't need to drop the trigger it also doesn't need to acquireACCESS EXCLUSIVElock which might be beneficial on write heavy tables.Relevant issue: #467