- 01 Oct, 2019 5 commits
-
-
Tomas Vondra authored
Commit 4d0e994e added support for partial TOAST decompression, so the decompression is interrupted after producing the requested prefix. For prefix and slices near the beginning of the entry, this may saves a lot of decompression work. That however only deals with decompression - the whole compressed entry was still fetched and re-assembled, even though the compression used only a small fraction of it. This commit improves that by computing how much compressed data may be needed to decompress the requested prefix, and then fetches only the necessary part. We always need to fetch a bit more compressed data than the requested (uncompressed) prefix, because the prefix may not be compressible at all and pglz itself adds a bit of overhead. That means this optimization is most effective when the requested prefix is much smaller than the whole compressed entry. Author: Binguo Bao Reviewed-by: Andrey Borodin, Tomas Vondra, Paul Ramsey Discussion: https://www.postgresql.org/message-id/flat/CAL-OGkthU9Gs7TZchf5OWaL-Gsi=hXqufTxKv9qpNG73d5na_g@mail.gmail.com
-
Michael Paquier authored
Several buildfarm machines have been complaining about the new module test_session_hooks to be unstable, like crake and thorntail. The issue was that the module was trying to log some start and end session activity for parallel workers, which makes little sense as they don't support DML, so just prevent this pattern to happen in the module. This could be reproduced by enforcing force_parallel_mode=regress, which is the value used by some of the buildfarm members. Discussion: https://postgr.es/m/20191001045246.GF2781@paquier.xyz
-
Michael Paquier authored
These hooks can be used in loadable modules. A simple test module is included. The first attempt was done with cd8ce3a2 but we lacked handling for NO_INSTALLCHECK in the MSVC scripts (problem solved afterwards by 431f1599) so the buildfarm got angry. This also fixes a couple of issues noticed upon review compared to the first attempt, so the code has slightly changed, resulting in a more simple test module. Author: Fabrízio de Royes Mello, Yugo Nagata Reviewed-by: Andrew Dunstan, Michael Paquier, Aleksandr Parfenov Discussion: https://postgr.es/m/20170720204733.40f2b7eb.nagata@sraoss.co.jp Discussion: https://postgr.es/m/20190823042602.GB5275@paquier.xyz
-
Michael Paquier authored
When using a client compiled without channel binding support (linking to OpenSSL 1.0.1 or older) to connect to a server which supports channel binding (linking to OpenSSL 1.0.2 or newer), libpq would generate a confusing error message with channel_binding=require for an SSL connection, where the server sends back SCRAM-SHA-256-PLUS: "channel binding is required, but server did not offer an authentication method that supports channel binding." This is confusing because the server did send a SASL mechanism able to support channel binding, but libpq was not able to detect that properly. The situation can be summarized as followed for the case described in the previous paragraph for the SASL mechanisms used with the various modes of channel_binding: 1) Client supports channel binding. 1-1) channel_binding = disable => OK, with SCRAM-SHA-256. 1-2) channel_binding = prefer => OK, with SCRAM-SHA-256-PLUS. 1-3) channel_binding = require => OK, with SCRAM-SHA-256-PLUS. 2) Client does not support channel binding. 2-1) channel_binding = disable => OK, with SCRAM-SHA-256. 2-2) channel_binding = prefer => OK, with SCRAM-SHA-256. 2-3) channel_binding = require => failure with new error message, instead of the confusing one. This commit updates case 2-3 to generate a better error message. Note that the SSL TAP tests are not impacted as it is not possible to test with mixed versions of OpenSSL for the backend and libpq. Reported-by: Tom Lane Author: Michael Paquier Reviewed-by: Jeff Davis, Tom Lane Discussion: https://postgr.es/m/24857.1569775891@sss.pgh.pa.us
-
Tomas Vondra authored
Adds accounting of memory allocated in a memory context. Compared to various ad hoc solutions, the main advantage is that the accounting is transparent and does not require direct control over allocations (this matters for use cases where the allocations happen in user code, like for example aggregate states allocated in a transition functions). To reduce overhead, the accounting happens at the block level (not for individual chunks) and only the context immediately owning the block is updated. When inquiring about amount of memory allocated in a context, we have to recursively walk all children contexts. This "lazy" accounting works well for cases with relatively small number of contexts in the relevant subtree and/or with infrequent inquiries. Author: Jeff Davis Reivewed-by: Tomas Vondra, Melanie Plageman, Soumyadeep Chakraborty Discussion: https://www.postgresql.org/message-id/flat/027a129b8525601c6a680d27ce3a7172dab61aab.camel@j-davis.com
-
- 30 Sep, 2019 11 commits
-
-
Andres Freund authored
That avoids unnecessary work during both interpreted execution, and JIT compiled expression evaluation. Both benefit from fewer expression steps needing be processed, and for interpreted execution there now is a fastpath dedicated to just fetching a value from a virtual slot. That's e.g. beneficial for hashjoins over nodes that perform projections, as the hashed columns are currently fetched individually. Author: Soumyadeep Chakraborty, Andres Freund Discussion: https://postgr.es/m/CAE-ML+9OKSN71+mHtfMD-L24oDp8dGTfaVjDU6U+j+FNAW5kRQ@mail.gmail.com
-
Andres Freund authored
This is mainly in preparation for adding further fastpath evaluation routines. Also reorder ExecJust*Var functions to be consistent with the order in which they're used. Author: Andres Freund Discussion: https://postgr.es/m/CAE-ML+9OKSN71+mHtfMD-L24oDp8dGTfaVjDU6U+j+FNAW5kRQ@mail.gmail.com
-
Tom Lane authored
This file had a very weird mix of tests that did "set plan_cache_mode = force_generic_plan" to get a generic plan, and tests that relied on using five dummy executions of a prepared statement. Converting them all to rely on plan_cache_mode is more consistent and shaves off a noticeable fraction of the test script's runtime. Discussion: https://postgr.es/m/11952.1569536725@sss.pgh.pa.us
-
Andrew Dunstan authored
This one was exposed by a12c75a1. Backpatch to release 11 where check_pg_config was introduced.
-
Andres Freund authored
The aforementioned commit orders the link to pgfeutils after libpq, which can fail because pgfeutils uses symbols from libpq. Per buildfarm animal jacana. Author: Andres Freund Discussion: https://postgr.es/m/20190930192013.r3wievljua2n3tbb@alap3.anarazel.de
-
Tom Lane authored
The behavior described in the PREPARE man page applies only for the default plan_cache_mode setting, so explain that properly. Rewrite some of the text while I'm here. Per suggestion from Bruce. Discussion: https://postgr.es/m/20190930155505.GA21095@momjian.us
-
Bruce Momjian authored
This commit adds a mention that the order of columns specified during multi-column most-common-value statistics is insignificant, and tries to simplify examples. Discussion: https://postgr.es/m/20190828162238.GA8360@momjian.us Backpatch-through: 12
-
Alvaro Herrera authored
Author: Alexey Kondratov Reviewed-by: Paul Guo Discussion: https://postgr.es/m/2f726102-3f1e-bf16-061e-501919473ace@postgrespro.ru
-
Alvaro Herrera authored
This is provided with a new switch --write-recovery-conf and reuses the pg_basebackup code. Author: Paul Guo, Jimmy Yih, Ashwin Agrawal Reviewed-by: Alexey Kondratov, Michaël Paquier, Álvaro Herrera Discussion: https://postgr.es/m/CAEET0ZEffUkXc48pg2iqARQgGRYDiiVxDu+yYek_bTwJF+q=Uw@mail.gmail.com
-
Michael Paquier authored
When compiling Postgres with OpenSSL 1.0.1 or older versions, SCRAM's channel binding cannot be supported as X509_get_signature_nid() is needed, which causes a regression test with channel_binding='require' to fail as the server cannot publish SCRAM-SHA-256-PLUS as SASL mechanism over an SSL connection. Fix the issue by using a method similar to c3d41ccf, making the test result conditional. The test passes if X509_get_signature_nid() is present, and when missing we test for a connection failure. Testing a connection failure is more useful than skipping the test as we should fail the connection if channel binding is required by the client but the server does not support it. Reported-by: Tom Lane, Michael Paquier Author: Michael Paquier Discussion: https://postgr.es/m/20190927024457.GA8485@paquier.xyz Discussion: https://postgr.es/m/24857.1569775891@sss.pgh.pa.us
-
Fujii Masao authored
In v11 or before, recovery target settings could not take effect in crash recovery because they are specified in recovery.conf and crash recovery always starts without recovery.conf. But commit 2dedf4d9 integrated recovery.conf into postgresql.conf and which unexpectedly allowed recovery target settings to take effect even in crash recovery. This is definitely not good behavior. To fix the issue, this commit makes crash recovery always ignore recovery target settings. Back-patch to v12. Author: Peter Eisentraut Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/e445616d-023e-a268-8aa1-67b8b335340c@pgmasters.net
-
- 29 Sep, 2019 6 commits
-
-
Andres Freund authored
In the course of 5567d12c, 356687bd and 317ffdfe, I changed BuildTupleHashTable[Ext]'s call to ExecBuildGroupingEqual to not pass in the parent node, but NULL. Which in turn prevents the tuple equality comparator from being JIT compiled. While that fixes bug #15486, it is not actually necessary after all of the above commits, as we don't re-build the comparator when using the new BuildTupleHashTableExt() interface (as the content of the hashtable are reset, but the TupleHashTable itself is not). Therefore re-allow jit compilation for callers that use BuildTupleHashTableExt with a separate context for "metadata" and content. As in the previous commit, there's ongoing work to make this easier to test to prevent such regressions in the future, but that infrastructure is not going to be backpatchable. The performance impact of not JIT compiling hashtable equality comparators can be substantial e.g. for aggregation queries that aggregate a lot of input rows to few output rows (when there are a lot of output groups, there will be fewer comparisons). Author: Andres Freund Discussion: https://postgr.es/m/20190927072053.njf6prdl3vb7y7qb@alap3.anarazel.de Backpatch: 11, just as 5567d12c
-
Andres Freund authored
For many queries the fact that the tuple descriptor from the lower node was not taken into account when determining whether the type of a slot is fixed, lead to tuple deforming for such upper nodes not to be JIT accelerated. I broke this in 675af5c0. There is ongoing work to enable writing regression tests for related behavior (including a patch that would have detected this regression), by optionally showing such details in EXPLAIN. But as it seems unlikely that that will be suitable for stable branches, just merge the fix for now. While it's fairly close to the 12 release window, the fact that 11 continues to perform JITed tuple deforming in these cases, that there's still cases where we do so in 12, and the fact that the performance regression can be sizable, weigh in favor of fixing it now. Author: Andres Freund Discussion: https://postgr.es/m/20190927072053.njf6prdl3vb7y7qb@alap3.anarazel.de Backpatch: 12-, where 675af5c0 was merged.
-
Andrew Dunstan authored
Windows does not enforce key file permissions checks in libpq, and psql can produce CRLF line endings on Windows. Backpatch to Release 12 (CRLF) and Release 11 (permissions check)
-
Peter Eisentraut authored
Recovery target parameters are all applied even in standby mode. The previous documentation mostly wished they were not but this was never the case. Discussion: https://www.postgresql.org/message-id/flat/e445616d-023e-a268-8aa1-67b8b335340c%40pgmasters.net
-
Peter Eisentraut authored
Forward-patched from PostgreSQL 12 release notes patch, for consistency.
-
- 28 Sep, 2019 3 commits
-
-
Peter Eisentraut authored
Some older OpenSSL versions (0.9.8 branch) define TLS*_VERSION macros but not the corresponding SSL_OP_NO_* macro, which causes the code for handling ssl_min_protocol_version/ssl_max_protocol_version to fail to compile. To fix, add more #ifdefs and error handling. Reported-by: Victor Wagner <vitus@wagner.pp.ru> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://www.postgresql.org/message-id/flat/20190924101859.09383b4f%40fafnir.local.vm
-
Tom Lane authored
This test already knew that, to get stable test output, it had to hide "loops" counts in EXPLAIN ANALYZE results. But that's not nearly enough: if we get a smaller number of workers than we planned for, then the "Workers Launched" number will change, and so will all the rows and loops counts up to the Gather node. This has resulted in repeated failures in the buildfarm, so adjust the test to filter out all these counts. (Really, we wouldn't bother with EXPLAIN ANALYZE at all here, except that currently the only way to verify that executor-time pruning has happened is to look for '(never executed)' annotations. Those are stable and needn't be filtered out.) Back-patch to v11 where the test was introduced. Discussion: https://postgr.es/m/11952.1569536725@sss.pgh.pa.us
-
Michael Paquier authored
HEAD supports OpenSSL 0.9.8 and newer versions, and this code likely got forgotten as its surrounding comments mention an incorrect version number. Author: Michael Paquier Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/20190927032311.GB8485@paquier.xyz
-
- 27 Sep, 2019 11 commits
-
-
Tom Lane authored
For the most part, we leave libpq-controlling environment variables alone during "make installcheck", reasoning that connecting to the server the user expects us to connect to may depend on those variables. But that argument doesn't apply to PGDATABASE, since we always want to connect to a specific database name within the server. And failing to unset it causes certain ECPG tests to fail, as various people have complained of in the past. So let's unset it. Possibly this should be back-patched, but I'm disinclined to do that right before 12.0 release. Maybe later. Discussion: https://postgr.es/m/20180318205548.2akxjqvo7hrk5wbc@alap3.anarazel.de Discussion: https://postgr.es/m/E1bOum4-0002EA-2y@gemulon.postgresql.org
-
Andres Freund authored
When compiling postgres using gcc -O3, there are false-positive warnings about the now initialized variables. Silence them. Author: Peter Eisentraut, Andres Freund Discussion: https://postgr.es/m/15fb2350-b8b8-e188-278f-0b34fdee5210@2ndquadrant.com
-
Alvaro Herrera authored
If we don't do this, the rewind fails if the server wasn't cleanly shut down, which seems unhelpful serving no purpose. Also provide a new option --no-ensure-shutdown to suppress this behavior, for alleged advanced usage that prefers to avoid the crash recovery. Authors: Paul Guo, Jimmy Yih, Ashwin Agrawal Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/CAEET0ZEffUkXc48pg2iqARQgGRYDiiVxDu+yYek_bTwJF+q=Uw@mail.gmail.com
-
Andres Freund authored
For some reason at least gcc-9 warns about the fallthrough, even though it otherwise recognizes that elog(ERROR, ...) doesn't return. Author: Andres Freund
-
Tom Lane authored
We've noted certain EXPLAIN queries on these tables occasionally showing unexpected plan choices. This seems to happen because VACUUM sometimes fails to update relpages/reltuples for one of these single-page tables, due to bgwriter or checkpointer holding a pin on the lone page at just the wrong time. To ensure those values get set, insert explicit ANALYZE operations on these tables after we finish populating them. This doesn't seem to affect any other test cases, so it's a usable fix. Back-patch to v12. In principle the issue exists further back, but we have not seen it before v12, so I won't risk back-patching further. Discussion: https://postgr.es/m/24480.1569518042@sss.pgh.pa.us
-
Tom Lane authored
This removes the last of the temporary debugging queries added to the regression tests by commit f03a9ca4. We've pretty much convinced ourselves that the plan instability we were seeing is due to VACUUM sometimes failing to update relpages/reltuples for a single-page table, due to bgwriter or checkpointer holding a pin on that page at just the wrong time. I'll push a workaround for that separately. Discussion: https://postgr.es/m/CA+hUKG+0CxrKRWRMf5ymN3gm+BECHna2B-q1w8onKBep4HasUw@mail.gmail.com
-
Tom Lane authored
The markup for optional parameters was neither correct nor consistent. In passing, fix a spelling mistake. Per report from Alex Macy. Some of these mistakes are old, so back-patch as appropriate. Discussion: https://postgr.es/m/156953522258.1204.12736099368284950578@wrigleys.postgresql.org
-
Peter Eisentraut authored
The documentation states that no target settings will be used when standby.signal is present, but this is not quite the case since recovery_target_timeline is a valid recovery target for a standby. Update the documentation with this exception. Author: David Steele <david@pgmasters.net> Discussion: https://www.postgresql.org/message-id/flat/e445616d-023e-a268-8aa1-67b8b335340c%40pgmasters.net
-
Michael Paquier authored
Author: Justin Pryzby Reviewed-by: Tatsuro Yamada Discussion: https://postgr.es/m/20190927022051.GC24334@telsasoft.com Backpatch-through: 12
-
Amit Kapila authored
The test name and the following test cases suggest the index created should be hash index, but it forgot to add 'using hash' in the test case. This in itself won't improve code coverage as there were some other tests which were covering the corresponding code. However, it is better if the added tests serve their actual purpose. Reported-by: Paul A Jungwirth Author: Paul A Jungwirth Reviewed-by: Mahendra Singh Backpatch-through: 9.4 Discussion: https://postgr.es/m/CA+renyV=Us-5XfMC25bNp-uWSj39XgHHmGE9Rh2cQKMegSj52g@mail.gmail.com
-
Michael Paquier authored
The code was enforcing AccessExclusiveLock for all custom relation options, which is incorrect as the APIs allow a custom lock level to be set. While on it, fix a couple of inconsistencies in the tests and the README of dummy_index_am. Oversights in commit 773df883. Discussion: https://postgr.es/m/20190925234152.GA2115@paquier.xyz
-
- 26 Sep, 2019 4 commits
-
-
Peter Eisentraut authored
-
Peter Eisentraut authored
-
Peter Eisentraut authored
Author: Liudmila Mantrova <l.mantrova@postgrespro.ru> Reported-by: Jeff Janes <jeff.janes@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/CAMkU%3D1wP-SO4KpiLxHJuPezTJCmK%3DJqefLXrr3eXFO7Qku%2BtMg%40mail.gmail.com
-
Peter Eisentraut authored
Update the note about why not to use // comments, even though it's now technically supported. The note about variable declarations was dropped here because it's addressed more properly later in the chapter. Discussion: https://www.postgresql.org/message-id/flat/156924954640.1117.6309209869705522549%40wrigleys.postgresql.org
-