postgresql/src/include
Thomas Munro db4f21e4a3 Redesign interrupt/cancel API for regex engine.
Previously, a PostgreSQL-specific callback checked by the regex engine
had a way to trigger a special error code REG_CANCEL if it detected that
the next call to CHECK_FOR_INTERRUPTS() would certainly throw via
ereport().

A later proposed bugfix aims to move some complex logic out of signal
handlers, so that it won't run until the next CHECK_FOR_INTERRUPTS(),
which makes the above design impossible unless we split
CHECK_FOR_INTERRUPTS() into two phases, one to run logic and another to
ereport().  We may develop such a system in the future, but for the
regex code it is no longer necessary.

An earlier commit moved regex memory management over to our
MemoryContext system.  Given that the purpose of the two-phase interrupt
checking was to free memory before throwing, something we don't need to
worry 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 the
main regex engine code (with a view to bein able to stay in sync with
other projects), do this with a new macro INTERRUPT(), customizable in
regcustom.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
2023-04-08 22:10:39 +12:00
..
access Allow logical decoding on standbys 2023-04-08 02:20:05 -07:00
archive Redesign archive modules 2023-02-17 14:26:42 +09:00
backup Update copyright for 2023 2023-01-02 15:00:37 -05:00
bootstrap Update copyright for 2023 2023-01-02 15:00:37 -05:00
catalog Allow logical decoding on standbys 2023-04-08 02:20:05 -07:00
commands Catalog NOT NULL constraints 2023-04-07 19:59:57 +02:00
common Support long distance matching for zstd compression 2023-04-06 17:18:42 +02:00
datatype Code review for commit 05a7be935. 2023-01-26 12:51:00 -05:00
executor Revert 11470f544e 2023-04-03 16:54:31 +03:00
fe_utils Update copyright for 2023 2023-01-02 15:00:37 -05:00
foreign Update copyright for 2023 2023-01-02 15:00:37 -05:00
jit Update copyright for 2023 2023-01-02 15:00:37 -05:00
lib Fix various typos in code and tests 2023-02-09 14:43:53 +09:00
libpq Add support for Kerberos credential delegation 2023-04-07 21:58:04 -04:00
mb Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodes Catalog NOT NULL constraints 2023-04-07 19:59:57 +02:00
optimizer Fix mis-handling of outer join quals generated by EquivalenceClasses. 2023-02-23 11:05:58 -05:00
parser SQL/JSON: support the IS JSON predicate 2023-03-31 22:34:04 +02:00
partitioning Fix various typos in code and tests 2023-02-09 14:43:53 +09:00
pch Update copyright for 2023 2023-01-02 15:00:37 -05:00
port Don't leak descriptors into subprograms. 2023-03-03 10:43:33 +13:00
portability instr_time: Represent time as an int64 on all platforms 2023-01-20 21:16:47 -08:00
postmaster Separate vacuum cost variables from GUCs 2023-04-07 00:54:53 +02:00
regex Redesign interrupt/cancel API for regex engine. 2023-04-08 22:10:39 +12:00
replication For cascading replication, wake physical and logical walsenders separately 2023-04-08 01:06:00 -07:00
rewrite Make Vars be outer-join-aware. 2023-01-30 13:16:20 -05:00
snowball Update copyright for 2023 2023-01-02 15:00:37 -05:00
statistics Update copyright for 2023 2023-01-02 15:00:37 -05:00
storage Handle logical slot conflicts on standby 2023-04-08 00:05:44 -07:00
tcop Update copyright for 2023 2023-01-02 15:00:37 -05:00
tsearch Update tsearch regex memory management. 2023-04-08 22:09:17 +12:00
utils Add io_direct setting (developer-only). 2023-04-08 16:35:07 +12:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h Introduce PG_IO_ALIGN_SIZE and align all I/O buffers. 2023-04-08 16:34:50 +12:00
fmgr.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
funcapi.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
getopt_long.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
Makefile Include headers of archive/ in installation 2023-03-10 20:08:10 +09:00
meson.build Include headers of archive/ in installation 2023-03-10 20:08:10 +09:00
miscadmin.h Add VACUUM/ANALYZE BUFFER_USAGE_LIMIT option 2023-04-07 11:40:31 +12:00
pg_config.h.in libpq: Add sslcertmode option to control client certificates 2023-03-24 13:34:26 +09:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.meson meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_config_manual.h Introduce PG_IO_ALIGN_SIZE and align all I/O buffers. 2023-04-08 16:34:50 +12:00
pg_getopt.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
pg_trace.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
pgstat.h Handle logical slot conflicts on standby 2023-04-08 00:05:44 -07:00
pgtar.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
pgtime.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
port.h Add SHELL_ERROR and SHELL_EXIT_CODE magic variables to psql. 2023-03-21 13:03:56 -04:00
postgres.h New header varatt.h split off from postgres.h 2023-01-10 05:54:36 +01:00
postgres_ext.h Move RelFileNumber declarations to common/relpath.h. 2022-09-27 12:01:57 -04:00
postgres_fe.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
varatt.h New header varatt.h split off from postgres.h 2023-01-10 05:54:36 +01:00
windowapi.h Update copyright for 2023 2023-01-02 15:00:37 -05:00