pgsql: Add error code for encryption failure in pgcrypto

2020-11-01 Thread Michael Paquier
Add error code for encryption failure in pgcrypto PXE_DECRYPT_FAILED exists already for decryption errors, and an equivalent for encryption did not exist. There is one code path that deals with such failures for OpenSSL but it used PXE_ERR_GENERIC, which was inconsistent. This switches this code

pgsql: Preserve index data in pg_statistic across REINDEX CONCURRENTLY

2020-11-01 Thread Michael Paquier
Preserve index data in pg_statistic across REINDEX CONCURRENTLY Statistics associated to an index got lost after running REINDEX CONCURRENTLY, while the non-concurrent case preserves these correctly. The concurrent and non-concurrent operations need to be consistent for the end-user, and missing s

pgsql: Preserve index data in pg_statistic across REINDEX CONCURRENTLY

2020-11-01 Thread Michael Paquier
Preserve index data in pg_statistic across REINDEX CONCURRENTLY Statistics associated to an index got lost after running REINDEX CONCURRENTLY, while the non-concurrent case preserves these correctly. The concurrent and non-concurrent operations need to be consistent for the end-user, and missing s

pgsql: Preserve index data in pg_statistic across REINDEX CONCURRENTLY

2020-11-01 Thread Michael Paquier
Preserve index data in pg_statistic across REINDEX CONCURRENTLY Statistics associated to an index got lost after running REINDEX CONCURRENTLY, while the non-concurrent case preserves these correctly. The concurrent and non-concurrent operations need to be consistent for the end-user, and missing s

pgsql: Avoid null pointer dereference if error result lacks SQLSTATE.

2020-11-01 Thread Tom Lane
Avoid null pointer dereference if error result lacks SQLSTATE. Although error results received from the backend should always have a SQLSTATE field, ones generated by libpq won't, making this code vulnerable to a crash after, say, untimely loss of connection. Noted by Coverity. Oversight in commi

pgsql: Avoid null pointer dereference if error result lacks SQLSTATE.

2020-11-01 Thread Tom Lane
Avoid null pointer dereference if error result lacks SQLSTATE. Although error results received from the backend should always have a SQLSTATE field, ones generated by libpq won't, making this code vulnerable to a crash after, say, untimely loss of connection. Noted by Coverity. Oversight in commi

pgsql: Avoid null pointer dereference if error result lacks SQLSTATE.

2020-11-01 Thread Tom Lane
Avoid null pointer dereference if error result lacks SQLSTATE. Although error results received from the backend should always have a SQLSTATE field, ones generated by libpq won't, making this code vulnerable to a crash after, say, untimely loss of connection. Noted by Coverity. Oversight in commi

pgsql: Avoid null pointer dereference if error result lacks SQLSTATE.

2020-11-01 Thread Tom Lane
Avoid null pointer dereference if error result lacks SQLSTATE. Although error results received from the backend should always have a SQLSTATE field, ones generated by libpq won't, making this code vulnerable to a crash after, say, untimely loss of connection. Noted by Coverity. Oversight in commi

pgsql: Avoid null pointer dereference if error result lacks SQLSTATE.

2020-11-01 Thread Tom Lane
Avoid null pointer dereference if error result lacks SQLSTATE. Although error results received from the backend should always have a SQLSTATE field, ones generated by libpq won't, making this code vulnerable to a crash after, say, untimely loss of connection. Noted by Coverity. Oversight in commi

pgsql: Avoid null pointer dereference if error result lacks SQLSTATE.

2020-11-01 Thread Tom Lane
Avoid null pointer dereference if error result lacks SQLSTATE. Although error results received from the backend should always have a SQLSTATE field, ones generated by libpq won't, making this code vulnerable to a crash after, say, untimely loss of connection. Noted by Coverity. Oversight in commi

pgsql: Avoid null pointer dereference if error result lacks SQLSTATE.

2020-11-01 Thread Tom Lane
Avoid null pointer dereference if error result lacks SQLSTATE. Although error results received from the backend should always have a SQLSTATE field, ones generated by libpq won't, making this code vulnerable to a crash after, say, untimely loss of connection. Noted by Coverity. Oversight in commi

pgsql: Fix two issues in TOAST decompression.

2020-11-01 Thread Tom Lane
Fix two issues in TOAST decompression. pglz_maximum_compressed_size() potentially underestimated the amount of compressed data required to produce N bytes of decompressed data; this is a fault in commit 11a078cf8. Separately from that, pglz_decompress() failed to protect itself against corrupt co

pgsql: Fix two issues in TOAST decompression.

2020-11-01 Thread Tom Lane
Fix two issues in TOAST decompression. pglz_maximum_compressed_size() potentially underestimated the amount of compressed data required to produce N bytes of decompressed data; this is a fault in commit 11a078cf8. Separately from that, pglz_decompress() failed to protect itself against corrupt co

pgsql: Allow run-time pruning on nested Append/MergeAppend nodes

2020-11-01 Thread David Rowley
Allow run-time pruning on nested Append/MergeAppend nodes Previously we only tagged on the required information to allow the executor to perform run-time partition pruning for Append/MergeAppend nodes belonging to base relations. It was thought that nested Append/MergeAppend nodes were just about

pgsql: Extend PageIsVerified() to handle more custom options

2020-11-01 Thread Michael Paquier
Extend PageIsVerified() to handle more custom options This is useful for checks of relation pages without having to load the pages into the shared buffers, and two cases can make use of that: page verification in base backups and the online, lock-safe, flavor. Compatibility is kept with past vers

pgsql: Extend PageIsVerified() to handle more custom options

2020-11-01 Thread Michael Paquier
Extend PageIsVerified() to handle more custom options This is useful for checks of relation pages without having to load the pages into the shared buffers, and two cases can make use of that: page verification in base backups and the online, lock-safe, flavor. Compatibility is kept with past vers

pgsql: Extend PageIsVerified() to handle more custom options

2020-11-01 Thread Michael Paquier
Extend PageIsVerified() to handle more custom options This is useful for checks of relation pages without having to load the pages into the shared buffers, and two cases can make use of that: page verification in base backups and the online, lock-safe, flavor. Compatibility is kept with past vers

pgsql: Use Enum for top level logical replication message types.

2020-11-01 Thread Amit Kapila
Use Enum for top level logical replication message types. Logical replication protocol uses a single byte character to identify a message type in logical replication protocol. The code uses string literals for the same. Use Enum so that 1. All the string literals used can be found at a single pla

pgsql: Fix some grammar and typos in comments and docs

2020-11-01 Thread Michael Paquier
Fix some grammar and typos in comments and docs The documentation fixes are backpatched down to where they apply. Author: Justin Pryzby Discussion: https://postgr.es/m/[email protected] Backpatch-through: 9.6 Branch -- REL_13_STABLE Details --- https://git.postgresql.o

pgsql: Fix some grammar and typos in comments and docs

2020-11-01 Thread Michael Paquier
Fix some grammar and typos in comments and docs The documentation fixes are backpatched down to where they apply. Author: Justin Pryzby Discussion: https://postgr.es/m/[email protected] Backpatch-through: 9.6 Branch -- REL_11_STABLE Details --- https://git.postgresql.o

pgsql: Fix some grammar and typos in comments and docs

2020-11-01 Thread Michael Paquier
Fix some grammar and typos in comments and docs The documentation fixes are backpatched down to where they apply. Author: Justin Pryzby Discussion: https://postgr.es/m/[email protected] Backpatch-through: 9.6 Branch -- REL_10_STABLE Details --- https://git.postgresql.o

pgsql: Fix some grammar and typos in comments and docs

2020-11-01 Thread Michael Paquier
Fix some grammar and typos in comments and docs The documentation fixes are backpatched down to where they apply. Author: Justin Pryzby Discussion: https://postgr.es/m/[email protected] Backpatch-through: 9.6 Branch -- REL9_6_STABLE Details --- https://git.postgresql.o

pgsql: Fix some grammar and typos in comments and docs

2020-11-01 Thread Michael Paquier
Fix some grammar and typos in comments and docs The documentation fixes are backpatched down to where they apply. Author: Justin Pryzby Discussion: https://postgr.es/m/[email protected] Backpatch-through: 9.6 Branch -- REL_12_STABLE Details --- https://git.postgresql.o

pgsql: Fix some grammar and typos in comments and docs

2020-11-01 Thread Michael Paquier
Fix some grammar and typos in comments and docs The documentation fixes are backpatched down to where they apply. Author: Justin Pryzby Discussion: https://postgr.es/m/[email protected] Backpatch-through: 9.6 Branch -- master Details --- https://git.postgresql.org/pg/c

Re: pgsql: Allow run-time pruning on nested Append/MergeAppend nodes

2020-11-01 Thread Michael Paquier
Hi David, On Mon, Nov 02, 2020 at 12:49:52AM +, David Rowley wrote: > Allow run-time pruning on nested Append/MergeAppend nodes > > Previously we only tagged on the required information to allow the > executor to perform run-time partition pruning for Append/MergeAppend > nodes belonging to b

Re: pgsql: Allow run-time pruning on nested Append/MergeAppend nodes

2020-11-01 Thread David Rowley
On Mon, 2 Nov 2020 at 19:30, Michael Paquier wrote: > fairywen is telling that some of the plans produced in these new tests > are not stable: Thanks. Looking at that now. David

pgsql: Fix unstable partition_prune regression tests

2020-11-01 Thread David Rowley
Fix unstable partition_prune regression tests This was broken recently by a929e17e5. I'd failed to remember that parallel tests should have their EXPLAIN output run through the explain_parallel_append function so that the output is stable when parallel workers fail to start. fairywren was first