pgsql: Add GUC checks for ssl_min_protocol_version and ssl_max_protocol

2020-01-17 Thread Michael Paquier
Add GUC checks for ssl_min_protocol_version and ssl_max_protocol_version Mixing incorrect bounds set in the SSL context leads to confusing error messages generated by OpenSSL which are hard to act on. New checks are added within the GUC machinery to improve the user experience as they apply to an

pgsql: Add GUC checks for ssl_min_protocol_version and ssl_max_protocol

2020-01-17 Thread Michael Paquier
Add GUC checks for ssl_min_protocol_version and ssl_max_protocol_version Mixing incorrect bounds set in the SSL context leads to confusing error messages generated by OpenSSL which are hard to act on. New checks are added within the GUC machinery to improve the user experience as they apply to an

Re: pgsql: Add a non-strict version of jsonb_set

2020-01-17 Thread Tom Lane
Andrew Dunstan writes: >> On Jan 17, 2020, at 12:44 PM, Tom Lane wrote: >>> Shoulda been a catversion bump in here, if only for protocol's sake. > I'd love to have a git pre-commit hook that would warn about this, it > seems to happen several times a year, and I know I've transgressed > more tha

Re: pgsql: Add a non-strict version of jsonb_set

2020-01-17 Thread Andrew Dunstan
On Fri, Jan 17, 2020 at 1:50 PM Andrew Dunstan wrote: > > > > > > > On Jan 17, 2020, at 12:44 PM, Tom Lane wrote: > > > > Andrew Dunstan writes: > >> Add a non-strict version of jsonb_set > > > > Shoulda been a catversion bump in here, if only for protocol's sake. > > > > (A useful rule of thum

pgsql: Avoid full scan of GIN indexes when possible

2020-01-17 Thread Alexander Korotkov
Avoid full scan of GIN indexes when possible The strategy of GIN index scan is driven by opclass-specific extract_query method. This method that needed search mode is GIN_SEARCH_MODE_ALL. This mode means that matching tuple may contain none of extracted entries. Simple example is '!term' tsquer

pgsql: Repair more failures with SubPlans in multi-row VALUES lists.

2020-01-17 Thread Tom Lane
Repair more failures with SubPlans in multi-row VALUES lists. Commit 9b63c13f0 turns out to have been fundamentally misguided: the parent node's subPlan list is by no means the only way in which a child SubPlan node can be hooked into the outer execution state. As shown in bug #16213 from Matt Jib

pgsql: Repair more failures with SubPlans in multi-row VALUES lists.

2020-01-17 Thread Tom Lane
Repair more failures with SubPlans in multi-row VALUES lists. Commit 9b63c13f0 turns out to have been fundamentally misguided: the parent node's subPlan list is by no means the only way in which a child SubPlan node can be hooked into the outer execution state. As shown in bug #16213 from Matt Jib

pgsql: Repair more failures with SubPlans in multi-row VALUES lists.

2020-01-17 Thread Tom Lane
Repair more failures with SubPlans in multi-row VALUES lists. Commit 9b63c13f0 turns out to have been fundamentally misguided: the parent node's subPlan list is by no means the only way in which a child SubPlan node can be hooked into the outer execution state. As shown in bug #16213 from Matt Jib

pgsql: Repair more failures with SubPlans in multi-row VALUES lists.

2020-01-17 Thread Tom Lane
Repair more failures with SubPlans in multi-row VALUES lists. Commit 9b63c13f0 turns out to have been fundamentally misguided: the parent node's subPlan list is by no means the only way in which a child SubPlan node can be hooked into the outer execution state. As shown in bug #16213 from Matt Jib

pgsql: Repair more failures with SubPlans in multi-row VALUES lists.

2020-01-17 Thread Tom Lane
Repair more failures with SubPlans in multi-row VALUES lists. Commit 9b63c13f0 turns out to have been fundamentally misguided: the parent node's subPlan list is by no means the only way in which a child SubPlan node can be hooked into the outer execution state. As shown in bug #16213 from Matt Jib

pgsql: Repair more failures with SubPlans in multi-row VALUES lists.

2020-01-17 Thread Tom Lane
Repair more failures with SubPlans in multi-row VALUES lists. Commit 9b63c13f0 turns out to have been fundamentally misguided: the parent node's subPlan list is by no means the only way in which a child SubPlan node can be hooked into the outer execution state. As shown in bug #16213 from Matt Jib

pgsql: Repair more failures with SubPlans in multi-row VALUES lists.

2020-01-17 Thread Tom Lane
Repair more failures with SubPlans in multi-row VALUES lists. Commit 9b63c13f0 turns out to have been fundamentally misguided: the parent node's subPlan list is by no means the only way in which a child SubPlan node can be hooked into the outer execution state. As shown in bug #16213 from Matt Jib

pgsql: Set ReorderBufferTXN->final_lsn more eagerly

2020-01-17 Thread Alvaro Herrera
Set ReorderBufferTXN->final_lsn more eagerly ... specifically, set it incrementally as each individual change is spilled down to disk. This way, it is set correctly when the transaction disappears without trace, ie. without leaving an XACT_ABORT wal record. (This happens when the server crashes

pgsql: Set ReorderBufferTXN->final_lsn more eagerly

2020-01-17 Thread Alvaro Herrera
Set ReorderBufferTXN->final_lsn more eagerly ... specifically, set it incrementally as each individual change is spilled down to disk. This way, it is set correctly when the transaction disappears without trace, ie. without leaving an XACT_ABORT wal record. (This happens when the server crashes

pgsql: Set ReorderBufferTXN->final_lsn more eagerly

2020-01-17 Thread Alvaro Herrera
Set ReorderBufferTXN->final_lsn more eagerly ... specifically, set it incrementally as each individual change is spilled down to disk. This way, it is set correctly when the transaction disappears without trace, ie. without leaving an XACT_ABORT wal record. (This happens when the server crashes

pgsql: Set ReorderBufferTXN->final_lsn more eagerly

2020-01-17 Thread Alvaro Herrera
Set ReorderBufferTXN->final_lsn more eagerly ... specifically, set it incrementally as each individual change is spilled down to disk. This way, it is set correctly when the transaction disappears without trace, ie. without leaving an XACT_ABORT wal record. (This happens when the server crashes

pgsql: Set ReorderBufferTXN->final_lsn more eagerly

2020-01-17 Thread Alvaro Herrera
Set ReorderBufferTXN->final_lsn more eagerly ... specifically, set it incrementally as each individual change is spilled down to disk. This way, it is set correctly when the transaction disappears without trace, ie. without leaving an XACT_ABORT wal record. (This happens when the server crashes

pgsql: Set ReorderBufferTXN->final_lsn more eagerly

2020-01-17 Thread Alvaro Herrera
Set ReorderBufferTXN->final_lsn more eagerly ... specifically, set it incrementally as each individual change is spilled down to disk. This way, it is set correctly when the transaction disappears without trace, ie. without leaving an XACT_ABORT wal record. (This happens when the server crashes

pgsql: Set ReorderBufferTXN->final_lsn more eagerly

2020-01-17 Thread Alvaro Herrera
Set ReorderBufferTXN->final_lsn more eagerly ... specifically, set it incrementally as each individual change is spilled down to disk. This way, it is set correctly when the transaction disappears without trace, ie. without leaving an XACT_ABORT wal record. (This happens when the server crashes

pgsql: Allocate freechunks bitmap as part of SlabContext

2020-01-17 Thread Tomas Vondra
Allocate freechunks bitmap as part of SlabContext The bitmap used by SlabCheck to cross-check free chunks in a block used to be allocated for each SlabCheck call, and was never freed. The memory leak could be fixed by simply adding a pfree call, but it's actually a bad idea to do any allocations i

pgsql: Allocate freechunks bitmap as part of SlabContext

2020-01-17 Thread Tomas Vondra
Allocate freechunks bitmap as part of SlabContext The bitmap used by SlabCheck to cross-check free chunks in a block used to be allocated for each SlabCheck call, and was never freed. The memory leak could be fixed by simply adding a pfree call, but it's actually a bad idea to do any allocations i

pgsql: Allocate freechunks bitmap as part of SlabContext

2020-01-17 Thread Tomas Vondra
Allocate freechunks bitmap as part of SlabContext The bitmap used by SlabCheck to cross-check free chunks in a block used to be allocated for each SlabCheck call, and was never freed. The memory leak could be fixed by simply adding a pfree call, but it's actually a bad idea to do any allocations i

pgsql: Allocate freechunks bitmap as part of SlabContext

2020-01-17 Thread Tomas Vondra
Allocate freechunks bitmap as part of SlabContext The bitmap used by SlabCheck to cross-check free chunks in a block used to be allocated for each SlabCheck call, and was never freed. The memory leak could be fixed by simply adding a pfree call, but it's actually a bad idea to do any allocations i