pgsql: Replace CLOBBER_CACHE_ALWAYS with run-time GUC

2021-01-06 Thread Peter Eisentraut
Replace CLOBBER_CACHE_ALWAYS with run-time GUC Forced cache invalidation (CLOBBER_CACHE_ALWAYS) has been impractical to use for testing in PostgreSQL because it's so slow and because it's toggled on/off only at build time. It is helpful when hunting bugs in any code that uses the sycache/relcache

pgsql: Add a test module for the regular expression package.

2021-01-06 Thread Tom Lane
Add a test module for the regular expression package. This module provides a function test_regex() that is functionally rather like regexp_matches(), but with additional debugging-oriented options and additional output. The debug options are somewhat obscure; they are chosen to match the API of t

pgsql: Report progress of COPY commands

2021-01-06 Thread Tomas Vondra
Report progress of COPY commands This commit introduces a view pg_stat_progress_copy, reporting progress of COPY commands. This allows rough estimates how far a running COPY progressed, with the caveat that the total number of bytes may not be available in some cases (e.g. when the input comes fr

pgsql: Add idle_session_timeout.

2021-01-06 Thread Tom Lane
Add idle_session_timeout. This GUC variable works much like idle_in_transaction_session_timeout, in that it kills sessions that have waited too long for a new client query. But it applies when we're not in a transaction, rather than when we are. Li Japin, reviewed by David Johnston and Hayato Ku

pgsql: Improve timeout.c's handling of repeated timeout set/cancel.

2021-01-06 Thread Tom Lane
Improve timeout.c's handling of repeated timeout set/cancel. A very common usage pattern is that we set a timeout that we don't expect to reach, cancel it after a little bit, and later repeat. With the original implementation of timeout.c, this results in one setitimer() call per timeout set or ca

pgsql: Fix allocation logic of cryptohash context data with OpenSSL

2021-01-06 Thread Michael Paquier
Fix allocation logic of cryptohash context data with OpenSSL The allocation of the cryptohash context data when building with OpenSSL was happening in the memory context of the caller of pg_cryptohash_create(), which could lead to issues with resowner cleanup if cascading resources are cleaned up

pgsql: Improve commentary in timeout.c.

2021-01-06 Thread Tom Lane
Improve commentary in timeout.c. On re-reading I realized that I'd missed one race condition in the new timeout code. It's safe, but add a comment explaining it. Discussion: https://postgr.es/m/CA+hUKG+o6pbuHBJSGnud=tadsuxyswa7cccpgct2qe9f6_4...@mail.gmail.com Branch -- master Details ---

pgsql: Fix bogus link in test comments.

2021-01-06 Thread Tom Lane
Fix bogus link in test comments. I apparently copied-and-pasted the wrong link in commit ca8217c10. Point it where it was meant to go. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/f7a1a805cb178653ea2a6c8991ad73b035af953e Modified Files -- src/test/mo