postgresql/contrib
Peter Eisentraut 1f0de66ea2 seg: pure parser and reentrant scanner
Use the flex %option reentrant and the bison option %pure-parser to
make the generated scanner and parser pure, reentrant, and
thread-safe.

Make the generated scanner use palloc() etc. instead of malloc() etc.
Previously, we only used palloc() for the buffer, but flex would still
use malloc() for its internal structures.  As a result, there could be
some small memory leaks in case of uncaught errors.  (We do catch
normal syntax errors as soft errors.)  Now, all the memory is under
palloc() control, so there are no more such issues.

Simplify flex scan buffer management: Instead of constructing the
buffer from pieces and then using yy_scan_buffer(), we can just use
yy_scan_string(), which does the same thing internally.

The previous code was necessary because we allocated the buffer with
palloc() and the rest of the state was handled by malloc().  But this
is no longer the case; everything is under palloc() now.

(We could even get rid of the yylex_destroy() call and just let the
memory context cleanup handle everything.  But for now, we preserve
the existing behavior.)

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Andreas Karlsson <andreas@proxel.se>
Discussion: https://www.postgresql.org/message-id/flat/eb6faeac-2a8a-4b69-9189-c33c520e5b7b@eisentraut.org
2024-12-18 08:47:53 +01:00
..
amcheck Remove remants of "snapshot too old" 2024-12-09 18:13:03 +02:00
auth_delay Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
auto_explain Simplify executor's determination of whether to use parallelism. 2024-12-09 14:38:19 -05:00
basebackup_to_shell Update copyright for 2024 2024-01-03 20:49:05 -05:00
basic_archive Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
bloom Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
bool_plperl Update copyright for 2024 2024-01-03 20:49:05 -05:00
btree_gin Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
btree_gist Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
citext Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
cube cube: pure parser and reentrant scanner 2024-12-18 08:47:34 +01:00
dblink Don't bother checking the result of SPI_connect[_ext] anymore. 2024-09-09 12:18:34 -04:00
dict_int Update copyright for 2024 2024-01-03 20:49:05 -05:00
dict_xsyn Remove ts_locale.c's lowerstr() 2024-12-17 14:04:55 +01:00
earthdistance contrib/earthdistance: Use SQL-standard function bodies. 2024-12-14 16:07:18 -05:00
file_fdw Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
fuzzystrmatch Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
hstore Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
hstore_plperl Update copyright for 2024 2024-01-03 20:49:05 -05:00
hstore_plpython Update copyright for 2024 2024-01-03 20:49:05 -05:00
intagg Update copyright for 2024 2024-01-03 20:49:05 -05:00
intarray Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
isn Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
jsonb_plperl Update copyright for 2024 2024-01-03 20:49:05 -05:00
jsonb_plpython Update copyright for 2024 2024-01-03 20:49:05 -05:00
lo contrib/lo: Use SQL-standard function bodies 2024-11-14 13:23:11 +09:00
ltree Remove ts_locale.c's t_isdigit(), t_isspace(), t_isprint() 2024-12-17 12:52:29 +01:00
ltree_plpython Update copyright for 2024 2024-01-03 20:49:05 -05:00
oid2name Apply more quoting to GUC names in messages 2024-09-04 13:50:44 +09:00
pageinspect Detect version mismatch in brin_page_items 2024-12-17 17:48:55 +01:00
passwordcheck Deprecate MD5 passwords. 2024-12-02 13:30:07 -06:00
pg_buffercache Add pg_buffercache_evict() function for testing. 2024-04-08 16:23:40 +12:00
pg_freespacemap pg_freespacemap: Use SQL-standard function bodies 2024-11-12 17:28:03 +09:00
pg_logicalinspect Add contrib/pg_logicalinspect. 2024-10-14 17:22:02 -07:00
pg_prewarm Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
pg_stat_statements Fix further fallout from EXPLAIN ANALYZE BUFFERS change 2024-12-12 09:50:00 +13:00
pg_surgery Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
pg_trgm Remove ts_locale.c's lowerstr() 2024-12-17 14:04:55 +01:00
pg_visibility Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
pg_walinspect Assign error codes where missing for user-facing failures 2024-07-04 09:48:40 +09:00
pgcrypto Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
pgrowlocks Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
pgstattuple Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
postgres_fdw Enable BUFFERS with EXPLAIN ANALYZE by default 2024-12-11 22:35:11 +13:00
seg seg: pure parser and reentrant scanner 2024-12-18 08:47:53 +01:00
sepgsql Add pg_constraint rows for not-null constraints 2024-11-08 13:28:48 +01:00
spi Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
sslinfo Revert "Add notBefore and notAfter to SSL cert info display" 2024-03-22 22:58:41 +01:00
start-scripts Remove gratuitous references to postmaster program 2023-01-26 10:48:32 +01:00
tablefunc Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
tcn Update copyright for 2024 2024-01-03 20:49:05 -05:00
test_decoding Fix invalidation of local pgstats references for entry reinitialization 2024-12-09 10:45:28 +09:00
tsm_system_rows Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
tsm_system_time Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
unaccent Remove ts_locale.c's t_isdigit(), t_isspace(), t_isprint() 2024-12-17 12:52:29 +01:00
uuid-ossp Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
vacuumlo Apply more quoting to GUC names in messages 2024-09-04 13:50:44 +09:00
xml2 xml2: Add tests for functions xpath_nodeset() and xpath_list() 2024-11-14 13:10:36 +09:00
contrib-global.mk Respect TEMP_CONFIG when pg_regress_check and friends are called 2016-02-27 12:28:21 -05:00
Makefile Add contrib/pg_logicalinspect. 2024-10-14 17:22:02 -07:00
meson.build Add contrib/pg_logicalinspect. 2024-10-14 17:22:02 -07:00
README

The PostgreSQL contrib tree
---------------------------

This subtree contains porting tools, analysis utilities, and plug-in
features that are not part of the core PostgreSQL system, mainly
because they address a limited audience or are too experimental to be
part of the main source tree.  This does not preclude their
usefulness.

User documentation for each module appears in the main SGML
documentation.

When building from the source distribution, these modules are not
built automatically, unless you build the "world" target.  You can
also build and install them all by running "make all" and "make
install" in this directory; or to build and install just one selected
module, do the same in that module's subdirectory.

Some directories supply new user-defined functions, operators, or
types.  To make use of one of these modules, after you have installed
the code you need to register the new SQL objects in the database
system by executing a CREATE EXTENSION command.  In a fresh database,
you can simply do

    CREATE EXTENSION module_name;

See the PostgreSQL documentation for more information about this
procedure.