You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Previously, a PostgreSQL-specific callback checked by the regex enginehad a way to trigger a special error code REG_CANCEL if it detected thatthe next call to CHECK_FOR_INTERRUPTS() would certainly throw viaereport().A later proposed bugfix aims to move some complex logic out of signalhandlers, so that it won't run until the next CHECK_FOR_INTERRUPTS(),which makes the above design impossible unless we splitCHECK_FOR_INTERRUPTS() into two phases, one to run logic and another toereport(). We may develop such a system in the future, but for theregex code it is no longer necessary.An earlier commit moved regex memory management over to ourMemoryContext system. Given that the purpose of the two-phase interruptchecking was to free memory before throwing, something we don't need toworry about anymore, it seems simpler to inject CHECK_FOR_INTERRUPTS()directly into cancelation points, and just let it throw.Since the plan is to keep PostgreSQL-specific concerns separate from themain regex engine code (with a view to bein able to stay in sync withother projects), do this with a new macro INTERRUPT(), customizable inregcustom.h and defaulting to nothing.Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/CA%2BhUKGK3PGKwcKqzoosamn36YW-fsuTdOPPF1i_rtEO%3DnEYKSg%40mail.gmail.com