pgsql: pgcrypto: Detect errors with EVP calls from OpenSSL

2020-12-07 Thread Michael Paquier
pgcrypto: Detect errors with EVP calls from OpenSSL The following routines are called within pgcrypto when handling digests but there were no checks for failures: - EVP_MD_CTX_size (can fail with -1 as of 3.0.0) - EVP_MD_CTX_block_size (can fail with -1 as of 3.0.0) - EVP_DigestInit_ex - EVP_Diges

pgsql: pgcrypto: Detect errors with EVP calls from OpenSSL

2020-12-07 Thread Michael Paquier
pgcrypto: Detect errors with EVP calls from OpenSSL The following routines are called within pgcrypto when handling digests but there were no checks for failures: - EVP_MD_CTX_size (can fail with -1 as of 3.0.0) - EVP_MD_CTX_block_size (can fail with -1 as of 3.0.0) - EVP_DigestInit_ex - EVP_Diges

pgsql: pgcrypto: Detect errors with EVP calls from OpenSSL

2020-12-07 Thread Michael Paquier
pgcrypto: Detect errors with EVP calls from OpenSSL The following routines are called within pgcrypto when handling digests but there were no checks for failures: - EVP_MD_CTX_size (can fail with -1 as of 3.0.0) - EVP_MD_CTX_block_size (can fail with -1 as of 3.0.0) - EVP_DigestInit_ex - EVP_Diges

pgsql: pgcrypto: Detect errors with EVP calls from OpenSSL

2020-12-07 Thread Michael Paquier
pgcrypto: Detect errors with EVP calls from OpenSSL The following routines are called within pgcrypto when handling digests but there were no checks for failures: - EVP_MD_CTX_size (can fail with -1 as of 3.0.0) - EVP_MD_CTX_block_size (can fail with -1 as of 3.0.0) - EVP_DigestInit_ex - EVP_Diges

pgsql: pgcrypto: Detect errors with EVP calls from OpenSSL

2020-12-07 Thread Michael Paquier
pgcrypto: Detect errors with EVP calls from OpenSSL The following routines are called within pgcrypto when handling digests but there were no checks for failures: - EVP_MD_CTX_size (can fail with -1 as of 3.0.0) - EVP_MD_CTX_block_size (can fail with -1 as of 3.0.0) - EVP_DigestInit_ex - EVP_Diges

pgsql: pgcrypto: Detect errors with EVP calls from OpenSSL

2020-12-07 Thread Michael Paquier
pgcrypto: Detect errors with EVP calls from OpenSSL The following routines are called within pgcrypto when handling digests but there were no checks for failures: - EVP_MD_CTX_size (can fail with -1 as of 3.0.0) - EVP_MD_CTX_block_size (can fail with -1 as of 3.0.0) - EVP_DigestInit_ex - EVP_Diges

pgsql: pgcrypto: Detect errors with EVP calls from OpenSSL

2020-12-07 Thread Michael Paquier
pgcrypto: Detect errors with EVP calls from OpenSSL The following routines are called within pgcrypto when handling digests but there were no checks for failures: - EVP_MD_CTX_size (can fail with -1 as of 3.0.0) - EVP_MD_CTX_block_size (can fail with -1 as of 3.0.0) - EVP_DigestInit_ex - EVP_Diges

pgsql: jit: Correct parameter type for generated expression evaluation

2020-12-07 Thread Andres Freund
jit: Correct parameter type for generated expression evaluation functions. clang only uses the 'i1' type for scalar booleans, not for pointers to booleans (as the pointer might be pointing into a larger memory allocation). Therefore a pointer-to-bool needs to the "storage" boolean. There's no kno

pgsql: jit: configure: Explicitly reference 'native' component.

2020-12-07 Thread Andres Freund
jit: configure: Explicitly reference 'native' component. Until recently 'native' was implicitly included via 'orcjit', but a change included in LLVM 11 (not yet released) removed a number of such indirect component references. Reported-By: Fabien COELHO Reported-By: Andres Freund Reported-By: T

pgsql: jit: Correct parameter type for generated expression evaluation

2020-12-07 Thread Andres Freund
jit: Correct parameter type for generated expression evaluation functions. clang only uses the 'i1' type for scalar booleans, not for pointers to booleans (as the pointer might be pointing into a larger memory allocation). Therefore a pointer-to-bool needs to the "storage" boolean. There's no kno

pgsql: backpatch "jit: Add support for LLVM 12."

2020-12-07 Thread Andres Freund
backpatch "jit: Add support for LLVM 12." As there haven't been problem on the buildfarm due to this change, backpatch 6c57f2ed16e now. Author: Andres Freund Discussion: https://postgr.es/m/[email protected] Backpatch: 11-, where jit support was added Branch

pgsql: jit: configure: Explicitly reference 'native' component.

2020-12-07 Thread Andres Freund
jit: configure: Explicitly reference 'native' component. Until recently 'native' was implicitly included via 'orcjit', but a change included in LLVM 11 (not yet released) removed a number of such indirect component references. Reported-By: Fabien COELHO Reported-By: Andres Freund Reported-By: T

pgsql: jit: configure: Explicitly reference 'native' component.

2020-12-07 Thread Andres Freund
jit: configure: Explicitly reference 'native' component. Until recently 'native' was implicitly included via 'orcjit', but a change included in LLVM 11 (not yet released) removed a number of such indirect component references. Reported-By: Fabien COELHO Reported-By: Andres Freund Reported-By: T

pgsql: backpatch "jit: Add support for LLVM 12."

2020-12-07 Thread Andres Freund
backpatch "jit: Add support for LLVM 12." As there haven't been problem on the buildfarm due to this change, backpatch 6c57f2ed16e now. Author: Andres Freund Discussion: https://postgr.es/m/[email protected] Backpatch: 11-, where jit support was added Branch

pgsql: jit: Correct parameter type for generated expression evaluation

2020-12-07 Thread Andres Freund
jit: Correct parameter type for generated expression evaluation functions. clang only uses the 'i1' type for scalar booleans, not for pointers to booleans (as the pointer might be pointing into a larger memory allocation). Therefore a pointer-to-bool needs to the "storage" boolean. There's no kno

pgsql: jit: Correct parameter type for generated expression evaluation

2020-12-07 Thread Andres Freund
jit: Correct parameter type for generated expression evaluation functions. clang only uses the 'i1' type for scalar booleans, not for pointers to booleans (as the pointer might be pointing into a larger memory allocation). Therefore a pointer-to-bool needs to the "storage" boolean. There's no kno

pgsql: backpatch "jit: Add support for LLVM 12."

2020-12-07 Thread Andres Freund
backpatch "jit: Add support for LLVM 12." As there haven't been problem on the buildfarm due to this change, backpatch 6c57f2ed16e now. Author: Andres Freund Discussion: https://postgr.es/m/[email protected] Backpatch: 11-, where jit support was added Branch

pgsql: jit: configure: Explicitly reference 'native' component.

2020-12-07 Thread Andres Freund
jit: configure: Explicitly reference 'native' component. Until recently 'native' was implicitly included via 'orcjit', but a change included in LLVM 11 (not yet released) removed a number of such indirect component references. Reported-By: Fabien COELHO Reported-By: Andres Freund Reported-By: T

pgsql: Avoid using tuple from syscache for update of pg_database.datfro

2020-12-07 Thread Michael Paquier
Avoid using tuple from syscache for update of pg_database.datfrozenxid pg_database.datfrozenxid gets updated using an in-place update at the end of vacuum or autovacuum. Since 96cdeae, as pg_database has a toast relation, it is possible for a pg_database tuple to have toast values if there is a l

Re: pgsql: Track total number of WAL records, FPIs and bytes generated in t

2020-12-07 Thread Andres Freund
Hi, On 2020-12-02 04:04:57 +, Fujii Masao wrote: > Track total number of WAL records, FPIs and bytes generated in the cluster. > > Commit 6b466bf5f2 allowed pg_stat_statements to track the number of > WAL records, full page images and bytes that each statement generated. > Similarly this comm

Re: pgsql: Change the attribute name in pg_stat_replication_slots view.

2020-12-07 Thread Andres Freund
Hi, On 2020-12-07 10:49:11 -0800, Andres Freund wrote: > On 2020-10-20 04:56:00 +, Amit Kapila wrote: > > Change the attribute name in pg_stat_replication_slots view. > > > > Change the attribute 'name' to 'slot_name' in pg_stat_replication_slots > > view to make it clear and that way we will

Re: pgsql: Change the attribute name in pg_stat_replication_slots view.

2020-12-07 Thread Andres Freund
Hi, On 2020-10-20 04:56:00 +, Amit Kapila wrote: > Change the attribute name in pg_stat_replication_slots view. > > Change the attribute 'name' to 'slot_name' in pg_stat_replication_slots > view to make it clear and that way we will be consistent with the other > places like pg_stat_wal_recei

pgsql: Add a couple of regression test cases related to array subscript

2020-12-07 Thread Tom Lane
Add a couple of regression test cases related to array subscripting. Exercise some error cases that were never reached in the existing regression tests. This is partly for code-coverage reasons, and partly to memorialize the current behavior in advance of planned changes for generic subscripting.

pgsql: Fix more race conditions in the newly-added pg_rewind test.

2020-12-07 Thread Heikki Linnakangas
Fix more race conditions in the newly-added pg_rewind test. pg_rewind looks at the control file to check what timeline a server is on. But promotion doesn't immediately write a checkpoint, it merely writes an end-of-recovery WAL record. If pg_rewind runs immediately after promotion, before the che

pgsql: Fix more race conditions in the newly-added pg_rewind test.

2020-12-07 Thread Heikki Linnakangas
Fix more race conditions in the newly-added pg_rewind test. pg_rewind looks at the control file to check what timeline a server is on. But promotion doesn't immediately write a checkpoint, it merely writes an end-of-recovery WAL record. If pg_rewind runs immediately after promotion, before the che

pgsql: Fix more race conditions in the newly-added pg_rewind test.

2020-12-07 Thread Heikki Linnakangas
Fix more race conditions in the newly-added pg_rewind test. pg_rewind looks at the control file to check what timeline a server is on. But promotion doesn't immediately write a checkpoint, it merely writes an end-of-recovery WAL record. If pg_rewind runs immediately after promotion, before the che

pgsql: Fix more race conditions in the newly-added pg_rewind test.

2020-12-07 Thread Heikki Linnakangas
Fix more race conditions in the newly-added pg_rewind test. pg_rewind looks at the control file to check what timeline a server is on. But promotion doesn't immediately write a checkpoint, it merely writes an end-of-recovery WAL record. If pg_rewind runs immediately after promotion, before the che

pgsql: Fix more race conditions in the newly-added pg_rewind test.

2020-12-07 Thread Heikki Linnakangas
Fix more race conditions in the newly-added pg_rewind test. pg_rewind looks at the control file to check what timeline a server is on. But promotion doesn't immediately write a checkpoint, it merely writes an end-of-recovery WAL record. If pg_rewind runs immediately after promotion, before the che

pgsql: Fix more race conditions in the newly-added pg_rewind test.

2020-12-07 Thread Heikki Linnakangas
Fix more race conditions in the newly-added pg_rewind test. pg_rewind looks at the control file to check what timeline a server is on. But promotion doesn't immediately write a checkpoint, it merely writes an end-of-recovery WAL record. If pg_rewind runs immediately after promotion, before the che

pgsql: Fix more race conditions in the newly-added pg_rewind test.

2020-12-07 Thread Heikki Linnakangas
Fix more race conditions in the newly-added pg_rewind test. pg_rewind looks at the control file to check what timeline a server is on. But promotion doesn't immediately write a checkpoint, it merely writes an end-of-recovery WAL record. If pg_rewind runs immediately after promotion, before the che