pgsql: Add tab-completion for CREATE FOREIGN TABLE.

2022-01-14 Thread Fujii Masao
Add tab-completion for CREATE FOREIGN TABLE. Unlike CREATE TABLE, CREATE FOREIGN TABLE is not allowed inside CREATE SCHEMA, so Matches() is used instead of TailMatches() for the tab-completion. Author: Tang Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/os0pr01mb61137e96e0551278782d11

pgsql: Ignore extended statistics for inheritance trees

2022-01-14 Thread Tomas Vondra
Ignore extended statistics for inheritance trees Since commit 859b3003de we only build extended statistics for individual relations, ignoring the child relations. This resolved the issue with updating catalog tuple twice, but we still tried to use the statistics when calculating estimates for the

pgsql: Ignore extended statistics for inheritance trees

2022-01-14 Thread Tomas Vondra
Ignore extended statistics for inheritance trees Since commit 859b3003de we only build extended statistics for individual relations, ignoring the child relations. This resolved the issue with updating catalog tuple twice, but we still tried to use the statistics when calculating estimates for the

pgsql: Ignore extended statistics for inheritance trees

2022-01-14 Thread Tomas Vondra
Ignore extended statistics for inheritance trees Since commit 859b3003de we only build extended statistics for individual relations, ignoring the child relations. This resolved the issue with updating catalog tuple twice, but we still tried to use the statistics when calculating estimates for the

pgsql: Ignore extended statistics for inheritance trees

2022-01-14 Thread Tomas Vondra
Ignore extended statistics for inheritance trees Since commit 859b3003de we only build extended statistics for individual relations, ignoring the child relations. This resolved the issue with updating catalog tuple twice, but we still tried to use the statistics when calculating estimates for the

pgsql: Ignore extended statistics for inheritance trees

2022-01-14 Thread Tomas Vondra
Ignore extended statistics for inheritance trees Since commit 859b3003de we only build extended statistics for individual relations, ignoring the child relations. This resolved the issue with updating catalog tuple twice, but we still tried to use the statistics when calculating estimates for the

pgsql: Ignore extended statistics for inheritance trees

2022-01-14 Thread Tomas Vondra
Ignore extended statistics for inheritance trees Since commit 859b3003de we only build extended statistics for individual relations, ignoring the child relations. This resolved the issue with updating catalog tuple twice, but we still tried to use the statistics when calculating estimates for the

pgsql: Unify VACUUM VERBOSE and autovacuum logging.

2022-01-14 Thread Peter Geoghegan
Unify VACUUM VERBOSE and autovacuum logging. The log_autovacuum_min_duration instrumentation used its own dedicated code for logging, which was not reused by VACUUM VERBOSE. This was highly duplicative, and sometimes led to each code path using slightly different accounting for essentially the sa

pgsql: Fix possible HOT corruption when RECENTLY_DEAD changes to DEAD w

2022-01-14 Thread Andres Freund
Fix possible HOT corruption when RECENTLY_DEAD changes to DEAD while pruning. Since dc7420c2c92 the horizon used for pruning is determined "lazily". A more accurate horizon is built on-demand, rather than in GetSnapshotData(). If a horizon computation is triggered between two HeapTupleSatisfiesVac

pgsql: Revert "Add new simple TAP test for tablespaces."

2022-01-14 Thread Thomas Munro
Revert "Add new simple TAP test for tablespaces." This reverts commit d1511fe1b040853f6e10d353e56b42bb96ae239d. Discussion: https://postgr.es/m/CA%2BhUKG%2BGBC-6QhOKt6Y7ccrXSjbRHB7Di295%3D0rAGhE7a7hSrQ%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdi

pgsql: Revert "Test replay of regression tests."

2022-01-14 Thread Thomas Munro
Revert "Test replay of regression tests." This reverts commit 123828a7fa563025d0ceee10cf1b2a253cd05319. Discussion: https://postgr.es/m/CA%2BhUKG%2BGBC-6QhOKt6Y7ccrXSjbRHB7Di295%3D0rAGhE7a7hSrQ%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/dccee

pgsql: Test replay of regression tests.

2022-01-14 Thread Thomas Munro
Test replay of regression tests. Add a new TAP test under src/test/recovery to run the standard regression tests while a streaming replica replays the WAL. This provides a basic workout for WAL decoding and redo code, and compares the replicated result. Optionally, enable (expensive) wal_consist

pgsql: Use in-place tablespaces in regression test.

2022-01-14 Thread Thomas Munro
Use in-place tablespaces in regression test. Remove the machinery from pg_regress that manages the testtablespace directory. Instead, use "in-place" tablespaces, because they work correctly when there is a streaming replica running on the same host. Reviewed-by: Andres Freund Reviewed-by: Micha

pgsql: Allow "in place" tablespaces.

2022-01-14 Thread Thomas Munro
Allow "in place" tablespaces. Provide a developer-only GUC allow_in_place_tablespaces, disabled by default. When enabled, tablespaces can be created with an empty LOCATION string, meaning that they should be created as a directory directly beneath pg_tblspc. This can be used for new testing scen

pgsql: Add new simple TAP test for tablespaces.

2022-01-14 Thread Thomas Munro
Add new simple TAP test for tablespaces. The tablespace tests in the main regression tests have been changed to use "in-place" tablespaces, so that they work when streamed to a replica on the same host. Add a new TAP test that exercises tablespaces with absolute paths, for coverage. Reviewed-by:

pgsql: Rename value node fields

2022-01-14 Thread Peter Eisentraut
Rename value node fields For the formerly-Value node types, rename the "val" field to a name specific to the node type, namely "ival", "fval", "sval", and "bsval". This makes some code clearer and catches mixups better. Reviewed-by: Pavel Stehule Discussion: https://www.postgresql.org/message-i

pgsql: Refactor AlterRole()

2022-01-14 Thread Peter Eisentraut
Refactor AlterRole() Get rid of the three-valued logic for the Boolean variables to track whether the value was been specified and what the new value should be. Instead, we can use the "dfoo" variables to determine whether the value was specified and should be applied. This was already done in so