pgsql: Doc: Fix example related to partition pruning

2019-09-24 Thread Michael Paquier
Doc: Fix example related to partition pruning Append node has been removed in v12 when there would be only one subnode under it. Author: Amit Langote Discussion: https://postgr.es/m/ca+hiwqhhs62w8zufxf4nbjvmbocxynd-jwowp-tfo2ahvp3...@mail.gmail.com Backpatch-through: 12 Branch -- master De

pgsql: Doc: Fix example related to partition pruning

2019-09-24 Thread Michael Paquier
Doc: Fix example related to partition pruning Append node has been removed in v12 when there would be only one subnode under it. Author: Amit Langote Discussion: https://postgr.es/m/ca+hiwqhhs62w8zufxf4nbjvmbocxynd-jwowp-tfo2ahvp3...@mail.gmail.com Backpatch-through: 12 Branch -- REL_12_STA

pgsql: Make more stable regression tests of dummy_index_am for string v

2019-09-24 Thread Michael Paquier
Make more stable regression tests of dummy_index_am for string validations Several buildfarm members (crake, loach and spurfowl) are complaining about two queries looking up at pg_class.reloptions which trigger the validation routines for string reloptions with default values. This commit limits

pgsql: Add dummy_index_am to src/test/modules/

2019-09-24 Thread Michael Paquier
Add dummy_index_am to src/test/modules/ This includes more tests dedicated to relation options, bringing the coverage of this code close to 100%, and the module can be used for other purposes, like a base template for an index AM implementation. Author: Nikolay Sharplov, Michael Paquier Reviewed-

pgsql: Allow definition of lock mode for custom reloptions

2019-09-24 Thread Michael Paquier
Allow definition of lock mode for custom reloptions Relation options can define a lock mode other than AccessExclusiveMode since 47167b7, but modules defining custom relation options did not really have a way to enforce that. Correct that by extending the current API set so as modules can define

pgsql: Fix failure with lock mode used for custom relation options

2019-09-24 Thread Michael Paquier
Fix failure with lock mode used for custom relation options In-core relation options can use a custom lock mode since 47167b7, that has lowered the lock available for some autovacuum parameters. However it forgot to consider custom relation options. This causes failures with ALTER TABLE SET when

pgsql: Fix failure with lock mode used for custom relation options

2019-09-24 Thread Michael Paquier
Fix failure with lock mode used for custom relation options In-core relation options can use a custom lock mode since 47167b7, that has lowered the lock available for some autovacuum parameters. However it forgot to consider custom relation options. This causes failures with ALTER TABLE SET when

pgsql: Fix failure with lock mode used for custom relation options

2019-09-24 Thread Michael Paquier
Fix failure with lock mode used for custom relation options In-core relation options can use a custom lock mode since 47167b7, that has lowered the lock available for some autovacuum parameters. However it forgot to consider custom relation options. This causes failures with ALTER TABLE SET when

pgsql: Fix failure with lock mode used for custom relation options

2019-09-24 Thread Michael Paquier
Fix failure with lock mode used for custom relation options In-core relation options can use a custom lock mode since 47167b7, that has lowered the lock available for some autovacuum parameters. However it forgot to consider custom relation options. This causes failures with ALTER TABLE SET when

pgsql: Fix failure with lock mode used for custom relation options

2019-09-24 Thread Michael Paquier
Fix failure with lock mode used for custom relation options In-core relation options can use a custom lock mode since 47167b7, that has lowered the lock available for some autovacuum parameters. However it forgot to consider custom relation options. This causes failures with ALTER TABLE SET when

pgsql: Fix bug in pairingheap_SpGistSearchItem_cmp()

2019-09-24 Thread Alexander Korotkov
Fix bug in pairingheap_SpGistSearchItem_cmp() Our item contains only so->numberOfNonNullOrderBys of distances. Reflect that in the loop upper bound. Discussion: https://postgr.es/m/53536807-784c-e029-6e92-6da802ab8d60%40postgrespro.ru Author: Nikita Glukhov Backpatch-through: 12 Branch --

pgsql: Fix bug in pairingheap_SpGistSearchItem_cmp()

2019-09-24 Thread Alexander Korotkov
Fix bug in pairingheap_SpGistSearchItem_cmp() Our item contains only so->numberOfNonNullOrderBys of distances. Reflect that in the loop upper bound. Discussion: https://postgr.es/m/53536807-784c-e029-6e92-6da802ab8d60%40postgrespro.ru Author: Nikita Glukhov Backpatch-through: 12 Branch --

pgsql: Rework WAL-reading supporting structs

2019-09-24 Thread Alvaro Herrera
Rework WAL-reading supporting structs The state-tracking of WAL reading in various places was pretty messy, mostly because the ancient physical-replication WAL reading code wasn't using the XLogReader abstraction. This led to some untidy code. Make it prettier by creating two additional supporti

pgsql: Prevent bogus pullup of constant-valued functions returning comp

2019-09-24 Thread Tom Lane
Prevent bogus pullup of constant-valued functions returning composite. Fix an oversight in commit 7266d0997: as it stood, the code failed when a function-in-FROM returns composite and can be simplified to a composite constant. For the moment, just test for composite result and abandon pullup if w

pgsql: Speedup truncations of relation forks.

2019-09-24 Thread Fujii Masao
Speedup truncations of relation forks. When a relation is truncated, shared_buffers needs to be scanned so that any buffers for the relation forks are invalidated in it. Previously, shared_buffers was scanned for each relation forks, i.e., MAIN, FSM and VM, when VACUUM truncated off any empty page

pgsql: Don't disable ccache when building with coverage support

2019-09-24 Thread Peter Eisentraut
Don't disable ccache when building with coverage support This was working around a bug in ccache that was fixed in ccache 3.2.2 (released 2015-05-10). (Users of older ccache versions can continue to set CCACHE_DISABLE themselves.) Discussion: https://www.postgresql.org/message-id/20190530191130