pgsql: Report wait event for cost-based vacuum delay.

2020-03-23 Thread Andres Freund
Report wait event for cost-based vacuum delay. Author: Justin Pryzby Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/cedffbdb8b137325a79e07a976457bc2314adf9b Modified Files -- doc/src/

pgsql: Prefer standby promotion over recovery pause.

2020-03-23 Thread Fujii Masao
Prefer standby promotion over recovery pause. Previously if a promotion was triggered while recovery was paused, the paused state continued. Also recovery could be paused by executing pg_wal_replay_pause() even while a promotion was ongoing. That is, recovery pause had higher priority over a stand

pgsql: Move routine building restore_command to src/common/

2020-03-23 Thread Michael Paquier
Move routine building restore_command to src/common/ restore_command has only been used until now by the backend, but there is a pending patch for pg_rewind to make use of that in the frontend. Author: Alexey Kondratov Reviewed-by: Andrey Borodin, Andres Freund, Alvaro Herrera, Alexander Korotkov

pgsql: Add wait events for WAL archive and recovery pause.

2020-03-23 Thread Fujii Masao
Add wait events for WAL archive and recovery pause. This commit introduces new wait events BackupWaitWalArchive and RecoveryPause. The former is reported while waiting for the WAL files required for the backup to be successfully archived. The latter is reported while waiting for recovery in pause

pgsql: Reduce test time for disk-based Hash Aggregation.

2020-03-23 Thread Jeff Davis
Reduce test time for disk-based Hash Aggregation. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/76df765e88fd9016e4b4f75dc69bcd9a1f335f72 Modified Files -- src/test/regress/expected/aggrega

pgsql: Report NULL as total backup size if it's not estimated.

2020-03-23 Thread Fujii Masao
Report NULL as total backup size if it's not estimated. Previously 0 was reported in pg_stat_progress_basebackup.total_backup if the total backup size was not estimated. Per discussion, our consensus is that NULL is better choise as the value in total_backup in that case. So this commit makes pg_s

pgsql: Fixes for Disk-based Hash Aggregation.

2020-03-23 Thread Jeff Davis
Fixes for Disk-based Hash Aggregation. Justin Pryzby raised a couple issues with commit 1f39bce0. Fixed. Also, tweak the way the size of a hash entry is estimated and the number of buckets is estimated when calling BuildTupleHashTableExt(). Discussion: https://www.postgresql.org/message-id/2020

pgsql: docs: add backend_type to file-fdw CSV log example

2020-03-23 Thread Bruce Momjian
docs: add backend_type to file-fdw CSV log example backend_type was added to the CVS log output in commit 70a7b4776b. Reported-by: Fabrízio de Royes Mello Discussion: https://postgr.es/m/cafcns+ruvrks3bv1j7yq-mvxsswmkja0cvh2yk5dd-xxvm8...@mail.gmail.com Backpatch-through: master Branch -

pgsql: Add regression tests for constraint errors in partitioned tables

2020-03-23 Thread Andres Freund
Add regression tests for constraint errors in partitioned tables. While #16293 only applied to 11 (and 10 to some degree), it seems best to add tests to all branches with partitioning support. Reported-By: Daniel WM Author: Andres Freund Bug: #16293 Discussion: https://postgr.es/m/16293-26f5777d1

pgsql: Fix potential crash after constraint violation errors in partiti

2020-03-23 Thread Andres Freund
Fix potential crash after constraint violation errors in partitioned tables. During the reporting of constraint violations for partitioned tables, ExecPartitionCheckEmitError(), ExecConstraints(), ExecWithCheckOptions() set the slot descriptor of the input slot to the root partition's tuple desc.

pgsql: Add regression tests for constraint errors in partitioned tables

2020-03-23 Thread Andres Freund
Add regression tests for constraint errors in partitioned tables. While #16293 only applied to 11 (and 10 to some degree), it seems best to add tests to all branches with partitioning support. Reported-By: Daniel WM Author: Andres Freund Bug: #16293 Discussion: https://postgr.es/m/16293-26f5777d1

pgsql: Add regression tests for constraint errors in partitioned tables

2020-03-23 Thread Andres Freund
Add regression tests for constraint errors in partitioned tables. While #16293 only applied to 11 (and 10 to some degree), it seems best to add tests to all branches with partitioning support. Reported-By: Daniel WM Author: Andres Freund Bug: #16293 Discussion: https://postgr.es/m/16293-26f5777d1

pgsql: Fix potential crash after constraint violation errors in partiti

2020-03-23 Thread Andres Freund
Fix potential crash after constraint violation errors in partitioned tables. During the reporting of constraint violations for partitioned tables, ExecPartitionCheckEmitError(), ExecConstraints(), ExecWithCheckOptions() set the slot descriptor of the input slot to the root partition's tuple desc.

pgsql: Add regression tests for constraint errors in partitioned tables

2020-03-23 Thread Andres Freund
Add regression tests for constraint errors in partitioned tables. While #16293 only applied to 11 (and 10 to some degree), it seems best to add tests to all branches with partitioning support. Reported-By: Daniel WM Author: Andres Freund Bug: #16293 Discussion: https://postgr.es/m/16293-26f5777d1

pgsql: Fix ordering in typedefs.list

2020-03-23 Thread Alexander Korotkov
Fix ordering in typedefs.list Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/0df94beb362e0ebc812170fbabd1aaf75136831a Modified Files -- src/tools/pgindent/typedefs.list | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

Re: pgsql: Disk-based Hash Aggregation.

2020-03-23 Thread Tom Lane
Jeff Davis writes: > On Mon, 2020-03-23 at 02:05 -0400, Tom Lane wrote: >> If there's no way to test the feature in some significantly-cheaper >> way, >> perhaps we should move this test out to a separate script that's not >> run >> by default. > I'll rework the tests. I wanted to be a bit more a

Re: pgsql: Disk-based Hash Aggregation.

2020-03-23 Thread Jeff Davis
On Mon, 2020-03-23 at 02:05 -0400, Tom Lane wrote: > If there's no way to test the feature in some significantly-cheaper > way, > perhaps we should move this test out to a separate script that's not > run > by default. I'll rework the tests. I wanted to be a bit more aggressive about testing right

pgsql: Doc: explain that LIKE et al can be used in ANY (sub-select) etc

2020-03-23 Thread Tom Lane
Doc: explain that LIKE et al can be used in ANY (sub-select) etc. This wasn't stated anywhere, and it's perhaps not that obvious, since we get questions about it from time to time. Also undocumented was that the parser actually translates these into operators. Discussion: https://postgr.es/m/CA

pgsql: Doc: explain that LIKE et al can be used in ANY (sub-select) etc

2020-03-23 Thread Tom Lane
Doc: explain that LIKE et al can be used in ANY (sub-select) etc. This wasn't stated anywhere, and it's perhaps not that obvious, since we get questions about it from time to time. Also undocumented was that the parser actually translates these into operators. Discussion: https://postgr.es/m/CA

pgsql: Doc: explain that LIKE et al can be used in ANY (sub-select) etc

2020-03-23 Thread Tom Lane
Doc: explain that LIKE et al can be used in ANY (sub-select) etc. This wasn't stated anywhere, and it's perhaps not that obvious, since we get questions about it from time to time. Also undocumented was that the parser actually translates these into operators. Discussion: https://postgr.es/m/CA

pgsql: Doc: explain that LIKE et al can be used in ANY (sub-select) etc

2020-03-23 Thread Tom Lane
Doc: explain that LIKE et al can be used in ANY (sub-select) etc. This wasn't stated anywhere, and it's perhaps not that obvious, since we get questions about it from time to time. Also undocumented was that the parser actually translates these into operators. Discussion: https://postgr.es/m/CA

pgsql: Doc: explain that LIKE et al can be used in ANY (sub-select) etc

2020-03-23 Thread Tom Lane
Doc: explain that LIKE et al can be used in ANY (sub-select) etc. This wasn't stated anywhere, and it's perhaps not that obvious, since we get questions about it from time to time. Also undocumented was that the parser actually translates these into operators. Discussion: https://postgr.es/m/CA

pgsql: Doc: explain that LIKE et al can be used in ANY (sub-select) etc

2020-03-23 Thread Tom Lane
Doc: explain that LIKE et al can be used in ANY (sub-select) etc. This wasn't stated anywhere, and it's perhaps not that obvious, since we get questions about it from time to time. Also undocumented was that the parser actually translates these into operators. Discussion: https://postgr.es/m/CA

pgsql: Fix our getopt_long's behavior for a command line argument of ju

2020-03-23 Thread Tom Lane
Fix our getopt_long's behavior for a command line argument of just "-". src/port/getopt_long.c failed on such an argument, always seeing it as an unrecognized switch. This is unhelpful; better is to treat such an item as a non-switch argument. That behavior is what we find in GNU's getopt_long()

pgsql: Fix our getopt_long's behavior for a command line argument of ju

2020-03-23 Thread Tom Lane
Fix our getopt_long's behavior for a command line argument of just "-". src/port/getopt_long.c failed on such an argument, always seeing it as an unrecognized switch. This is unhelpful; better is to treat such an item as a non-switch argument. That behavior is what we find in GNU's getopt_long()

pgsql: Fix our getopt_long's behavior for a command line argument of ju

2020-03-23 Thread Tom Lane
Fix our getopt_long's behavior for a command line argument of just "-". src/port/getopt_long.c failed on such an argument, always seeing it as an unrecognized switch. This is unhelpful; better is to treat such an item as a non-switch argument. That behavior is what we find in GNU's getopt_long()

pgsql: Fix our getopt_long's behavior for a command line argument of ju

2020-03-23 Thread Tom Lane
Fix our getopt_long's behavior for a command line argument of just "-". src/port/getopt_long.c failed on such an argument, always seeing it as an unrecognized switch. This is unhelpful; better is to treat such an item as a non-switch argument. That behavior is what we find in GNU's getopt_long()

pgsql: Fix our getopt_long's behavior for a command line argument of ju

2020-03-23 Thread Tom Lane
Fix our getopt_long's behavior for a command line argument of just "-". src/port/getopt_long.c failed on such an argument, always seeing it as an unrecognized switch. This is unhelpful; better is to treat such an item as a non-switch argument. That behavior is what we find in GNU's getopt_long()

pgsql: Fix our getopt_long's behavior for a command line argument of ju

2020-03-23 Thread Tom Lane
Fix our getopt_long's behavior for a command line argument of just "-". src/port/getopt_long.c failed on such an argument, always seeing it as an unrecognized switch. This is unhelpful; better is to treat such an item as a non-switch argument. That behavior is what we find in GNU's getopt_long()