pgsql: Add pg_nodiscard function declaration specifier

2020-11-11 Thread Peter Eisentraut
Add pg_nodiscard function declaration specifier pg_nodiscard means the compiler should warn if the result of a function call is ignored. The name "nodiscard" is chosen in alignment with (possibly future) C and C++ standards. It maps to the GCC attribute warn_unused_result. Reviewed-by: Michael

pgsql: Add pg_nodiscard decorations to some functions

2020-11-11 Thread Peter Eisentraut
Add pg_nodiscard decorations to some functions Especially for the list API such as lappend() forgetting to assign the return value is a common problem. Reviewed-by: Michael Paquier Discussion: https://www.postgresql.org/message-id/flat/[email protected] Branc

Re: pgsql: Declare assorted array functions using anycompatible not anyelem

2020-11-11 Thread Andrew Dunstan
On 11/10/20 3:31 PM, Tom Lane wrote: > Andrew Dunstan writes: >> On 11/9/20 5:41 PM, Tom Lane wrote: >>> What I have in mind to apply to 9.5 through 13 is per attached. >> You also need to modify first_el_agg_any. > ... doh. That one is a little messier because there's no equally useful > subst

pgsql: Remove vacuumdb --analyze-in-stages from pg_upgrade tests

2020-11-11 Thread Magnus Hagander
Remove vacuumdb --analyze-in-stages from pg_upgrade tests This step was only there to test the script when we generated those, but commit 8f113698b6 removed those scripts, so it's not needed anymore. Reported-By: Peter Eisentraut Discussion: https://postgr.es/m/ea403f46-2b33-a7de-618e-9cab35a69.

pgsql: Remove line missed in previous commit

2020-11-11 Thread Magnus Hagander
Remove line missed in previous commit Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4e3ffd5981536f93787ae6d81bc179da0acc423e Modified Files -- src/tools/msvc/vcregress.pl | 1 - 1 file changed, 1 deletion(-)

pgsql: Fix some stray whitespace in parser files

2020-11-11 Thread Peter Eisentraut
Fix some stray whitespace in parser files Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/0af302af40669d9bc6de7a202e4723fee39d9376 Modified Files -- src/backend/bootstrap/bootscanner.l | 2 +- src/backend/parser/gram.y| 18 --

pgsql: Remove duplicate code in brin_memtuple_initialize

2020-11-11 Thread Tomas Vondra
Remove duplicate code in brin_memtuple_initialize Commit 8bf74967dab moved some of the code from brin_new_memtuple to brin_memtuple_initialize, but this resulted in some of the code being duplicate. Fix by removing the duplicate lines and backpatch to 10. Author: Tomas Vondra Backpatch-through: 1

pgsql: Remove duplicate code in brin_memtuple_initialize

2020-11-11 Thread Tomas Vondra
Remove duplicate code in brin_memtuple_initialize Commit 8bf74967dab moved some of the code from brin_new_memtuple to brin_memtuple_initialize, but this resulted in some of the code being duplicate. Fix by removing the duplicate lines and backpatch to 10. Author: Tomas Vondra Backpatch-through: 1

pgsql: Remove duplicate code in brin_memtuple_initialize

2020-11-11 Thread Tomas Vondra
Remove duplicate code in brin_memtuple_initialize Commit 8bf74967dab moved some of the code from brin_new_memtuple to brin_memtuple_initialize, but this resulted in some of the code being duplicate. Fix by removing the duplicate lines and backpatch to 10. Author: Tomas Vondra Backpatch-through: 1

pgsql: Remove duplicate code in brin_memtuple_initialize

2020-11-11 Thread Tomas Vondra
Remove duplicate code in brin_memtuple_initialize Commit 8bf74967dab moved some of the code from brin_new_memtuple to brin_memtuple_initialize, but this resulted in some of the code being duplicate. Fix by removing the duplicate lines and backpatch to 10. Author: Tomas Vondra Backpatch-through: 1

pgsql: Remove duplicate code in brin_memtuple_initialize

2020-11-11 Thread Tomas Vondra
Remove duplicate code in brin_memtuple_initialize Commit 8bf74967dab moved some of the code from brin_new_memtuple to brin_memtuple_initialize, but this resulted in some of the code being duplicate. Fix by removing the duplicate lines and backpatch to 10. Author: Tomas Vondra Backpatch-through: 1

pgsql: Remove useless SHA256 initialization when not using backup manif

2020-11-11 Thread Michael Paquier
Remove useless SHA256 initialization when not using backup manifests Attempting to take a base backup with Postgres linking to a build of OpenSSL with FIPS enabled currently fails with or even without a backup manifest requested because of this mandatory SHA256 initialization used for the manifest

pgsql: Remove useless SHA256 initialization when not using backup manif

2020-11-11 Thread Michael Paquier
Remove useless SHA256 initialization when not using backup manifests Attempting to take a base backup with Postgres linking to a build of OpenSSL with FIPS enabled currently fails with or even without a backup manifest requested because of this mandatory SHA256 initialization used for the manifest

pgsql: pg_stat_statements: track number of rows processed by REFRESH MA

2020-11-11 Thread Fujii Masao
pg_stat_statements: track number of rows processed by REFRESH MATERIALIZED VIEW. Commit 6023b7ea71 allowed pg_stat_statements to track the number of rows retrieved or affected by some utility commands including CREATE MATERIALIZED VIEW. However it did not track the rowcount of REFRESH MATERIALIZED

pgsql: Fix name of the macro for getting signature length trgm_gist.c

2020-11-11 Thread Alexander Korotkov
Fix name of the macro for getting signature length trgm_gist.c 911e702077 has introduced the opclass parameters including signature length for a set of GiST opclasses. Due to copy-pasting, macro for getting the signature length in trgm_gist.c was named LTREE_GET_ASIGLEN(). Fix that by renaming t

pgsql: Fix name of the macro for getting signature length trgm_gist.c

2020-11-11 Thread Alexander Korotkov
Fix name of the macro for getting signature length trgm_gist.c 911e702077 has introduced the opclass parameters including signature length for a set of GiST opclasses. Due to copy-pasting, macro for getting the signature length in trgm_gist.c was named LTREE_GET_ASIGLEN(). Fix that by renaming t

pgsql: Use standard SIGHUP and SIGTERM handlers in walreceiver.

2020-11-11 Thread Fujii Masao
Use standard SIGHUP and SIGTERM handlers in walreceiver. Commit 1e53fe0e70 changed background processes so that they use standard SIGHUP handler. Like that, this commit makes walreceiver use standard SIGHUP and SIGTERM handlers, to simplify the code. As the side effect of this commit, walreceiver

pgsql: Fix typo in contrib/pg_trgm/pg_trgm--1.4--1.5.sql

2020-11-11 Thread Alexander Korotkov
Fix typo in contrib/pg_trgm/pg_trgm--1.4--1.5.sql Backpatch-through: 13 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3e8ec5b1408a15fb41cada2635163a598d8607d1 Modified Files -- contrib/pg_trgm/pg_trgm--1.4--1.5.sql | 2 +- 1 file changed, 1 insertion(+

pgsql: Fix typo in contrib/pg_trgm/pg_trgm--1.4--1.5.sql

2020-11-11 Thread Alexander Korotkov
Fix typo in contrib/pg_trgm/pg_trgm--1.4--1.5.sql Backpatch-through: 13 Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/6058f22324c8781b1914551ab4da431224c3a7dd Modified Files -- contrib/pg_trgm/pg_trgm--1.4--1.5.sql | 2 +- 1 file changed, 1 inse

pgsql: Clean up optional rules in grammar

2020-11-11 Thread Peter Eisentraut
Clean up optional rules in grammar Various rules for optional keywords contained unnecessary rules and type declarations. Remove those, thus making the output a tiny bit smaller. Reviewed-by: Heikki Linnakangas Discussion: https://www.postgresql.org/message-id/flat/e9eed669-e32d-6919-fed4-acc0