- 05 May, 2020 4 commits
-
-
Peter Eisentraut authored
-
Michael Paquier authored
The following docs are updated: - High-availaility section - pg_basebackup - pg_receivewal Per the principle of least privilege, we want to encourage users to interact with those areas using roles that have replication rights, but superusers were mentioned first. Author: Daniel Gustafsson Reviewed-by: Fujii Masao, Michael Paquier Discussion: https://postgr.es/m/ECEBD212-7101-41EB-84F3-2F356E4B6401@yesql.se
-
Bruce Momjian authored
This still needs markup, indenting, and word wrap.
-
Amit Kapila authored
In commit 33e05f89, we have added the option to display WAL usage statistics in Explain and auto_explain. The display format used two spaces between each field which is inconsistent with Buffer usage statistics which is using one space between each field. Change the format to make WAL usage statistics consistent with Buffer usage statistics. This commit also changed the usage of "full page writes" to "full page images" for WAL usage statistics to make it consistent with other parts of code and docs. Author: Julien Rouhaud, Amit Kapila Reviewed-by: Justin Pryzby, Kyotaro Horiguchi and Amit Kapila Discussion: https://postgr.es/m/CAB-hujrP8ZfUkvL5OYETipQwA=e3n7oqHFU=4ZLxWS_Cza3kQQ@mail.gmail.com
-
- 04 May, 2020 4 commits
-
-
Tom Lane authored
The PDF toolchain defaults to laying out all columns of a table with equal widths, in contrast to the HTML rendering which automatically varies the column widths to fit the data. In many places, this results in very badly laid-out tables, with lots of useless whitespace in some places and text that overruns its cell in other places. For tables that have reasonably static content, we can improve matters by adding <colspec> entries to hand-assign the column widths. This commit does that for a few of the tables that were worst off; it eliminates close to 200 "contents ... exceed the available area" warnings in an A4 PDF build. I also forced align="left" in these tables, overriding the PDF toolchain's default which is evidently "justify". (The HTML toolchain seems to default to that already.) Anyplace where things are tight enough that we need to worry about this, forced justification tends to look truly awful.
-
Peter Geoghegan authored
Add a test case to contrib/amcheck that creates coverage of code paths that are used to verify posting list tuples (tuples created when deduplication merges together existing tuples to avoid a leaf page split).
-
Tom Lane authored
We had a mishmash of <replaceable>, <replaceable class="parameter">, and <parameter> markup for operator/function arguments. Use <parameter> consistently for things that are in fact names of parameters (including OUT parameters), reserving <replaceable> for things that aren't. The latter class includes some made-up-by-the-docs type class names, like "numeric_type", as well as placeholders for arguments that don't have well-defined types. Possibly we could do better with those categories as well, but for the moment I'm content not to have parameter names marked up in different ways in different places. (This commit aligns the earlier sections of chapter 9 with a policy that I'd arrived at while working on commit 1ad23335, which is why the last few sections need no changes.)
-
Tom Lane authored
With the usual quota of minor and less-minor editorial changes.
-
- 03 May, 2020 2 commits
-
-
Alexander Korotkov authored
Reported-by: Oleg Bartunov
-
Peter Eisentraut authored
-
- 02 May, 2020 5 commits
-
-
Peter Geoghegan authored
Remove one of the arguments to btvacuumpage(), and give up on the idea that it's a recursive function. We now use the term "backtracking" to refer to the case where an earlier block must be visited to make sure no tuples that need to be removed were missed. Advertising btvacuumpage() as a recursive function was unhelpful. In reality the function always simulates recursion with a loop (it doesn't actually call itself). This wasn't just necessary as a precaution (per the comments mentioning tail recursion), though. There is no reliable natural limit on the number of times we can backtrack. There are important behavioral difference when "recursing"/backtracking, mostly related to page deletion. We don't perform page deletion when backtracking due to the extra complexity. And when we recurse, we're not performing a physical order scan anymore, so we expect fairly different conditions to hold for the page. Structuring the code like this makes it clearer how _bt_pagedel() cooperates with btvacuumpage() and btvacuumscan() (as established in commit b0229f26 and commit 73a076b0). Author: Peter Geoghegan Reviewed-By: Masahiko Sawada Discussion: https://postgr.es/m/CAH2-WzmRGMDWiLMcb+zagG9652PboNN4Gfcq1Gc_wJL6A716MA@mail.gmail.com
-
Stephen Frost authored
If the client is compiled with GSSAPI support and tries to start up GSS with the server, but the server is not compiled with GSSAPI support, we would mistakenly end up falling through to call ProcessStartupPacket with secure_done = true, but the client might then try to perform SSL, which the backend wouldn't understand and we'd end up failing the connection with: FATAL: unsupported frontend protocol 1234.5679: server supports 2.0 to 3.0 Fix by arranging to track ssl_done independently from gss_done, instead of trying to use the same boolean for both. Author: Andrew Gierth Discussion: https://postgr.es/m/87h82kzwqn.fsf@news-spur.riddles.org.uk Backpatch: 12-, where GSSAPI encryption was added.
-
Tomas Vondra authored
The extra memset meant pg_stat_reset_slru() always reset all the entries even when reset of a single entry was requested, but the timestamp was left uninitialized. Reported-by: Atsushi Torikoshi Discussion: https://postgr.es/m/CACZ0uYFe16pjZxQYaTn53mspyM7dgMPYL3DJLjjPw69GMCC2Ow%40mail.gmail.com
-
Tomas Vondra authored
This should have been included in 2e08d314. Reported-by: Fujii Masao Discussion: https://postgr.es/m/20200119143707.gyinppnigokesjok@development
-
Peter Eisentraut authored
-
- 01 May, 2020 10 commits
-
-
Tomas Vondra authored
Commit de0dc1a8 added code to cost_incremental_sort to handle varno 0. Explicitly removing the RelabelType is not really necessary, because the pull_varnos handles that just fine, which simplifies the code a bit. Author: Richard Guo Discussion: https://postgr.es/m/CAMbWs4_3_D2J5XxOuw68hvn0-gJsw9FXNSGcZka9aTymn9UJ8A%40mail.gmail.com Discussion: https://postgr.es/m/20200411214639.GK2228%40telsasoft.com
-
Tomas Vondra authored
The "pg_xact" entry was duplicate with "clog" and was added by mistake. Reported-by: Fujii Masao Discussion: https://postgr.es/m/20200119143707.gyinppnigokesjok@development
-
Tom Lane authored
Writing a trailing semicolon in a macro is almost never the right thing, because you almost always want to write a semicolon after each macro call instead. (Even if there was some reason to prefer not to, pgindent would probably make a hash of code formatted that way; so within PG the rule should basically be "don't do it".) Thus, if we have a semi inside the macro, the compiler sees "something;;". Much of the time the extra empty statement is harmless, but it could lead to mysterious syntax errors at call sites. In perhaps an overabundance of neatnik-ism, let's run around and get rid of the excess semicolons whereever possible. The only thing worse than a mysterious syntax error is a mysterious syntax error that only happens in the back branches; therefore, backpatch these changes where relevant, which is most of them because most of these mistakes are old. (The lack of reported problems shows that this is largely a hypothetical issue, but still, it could bite us in some future patch.) John Naylor and Tom Lane Discussion: https://postgr.es/m/CACPNZCs0qWTqJ2QUSGJ07B7uvAvzMb-KbG2q+oo+J3tsWN5cqw@mail.gmail.com
-
Tom Lane authored
With the usual quota of minor editorial changes.
-
Peter Geoghegan authored
On further reflection, code comments added by commit b0229f26 slightly misrepresented how we determine the oldest bpto.xact for the index. btvacuumpage() does not treat the bpto.xact of a page that it put in the FSM as a candidate to be the oldest deleted page (the delete-marked page that has the oldest bpto.xact XID among all pages encountered). The definition of a deleted page for the purposes of the bpto.xact calculation is different from the definition used by the bulk delete statistics. The bulk delete statistics don't distinguish between pages that were deleted by the current VACUUM, pages deleted by a previous VACUUM operation but not yet recyclable/reusable, and pages that are reusable (though reusable pages are counted separately). Backpatch: 11-, just like commit b0229f26.
-
Peter Geoghegan authored
-
Peter Geoghegan authored
The logic for determining how many nbtree pages in an index are deleted pages sometimes undercounted pages. Pages that were deleted by the current VACUUM operation (as opposed to some previous VACUUM operation whose deleted pages have yet to be reused) were sometimes overlooked. The final count is exposed to users through VACUUM VERBOSE's "%u index pages have been deleted" output. btvacuumpage() avoided double-counting when _bt_pagedel() deleted more than one page by assuming that only one page was deleted, and that the additional deleted pages would get picked up during a future call to btvacuumpage() by the same VACUUM operation. _bt_pagedel() can legitimately delete pages that the btvacuumscan() scan will not visit again, though, so that assumption was slightly faulty. Fix the accounting by teaching _bt_pagedel() about its caller's requirements. It now only reports on pages that it knows btvacuumscan() won't visit again (including the current btvacuumpage() page), so everything works out in the end. This bug has been around forever. Only backpatch to v11, though, to keep _bt_pagedel() is sync on the branches that have today's bugfix commit b0229f26. Note that this commit changes the signature of _bt_pagedel(), just like commit b0229f26. Author: Peter Geoghegan Reviewed-By: Masahiko Sawada Discussion: https://postgr.es/m/CAH2-WzkrXBcMQWAYUJMFTTvzx_r4q=pYSjDe07JnUXhe+OZnJA@mail.gmail.com Backpatch: 11-
-
Peter Geoghegan authored
Commit 857f9c36 (which taught nbtree VACUUM to skip a scan of the index from btcleanup in situations where it doesn't seem worth it) made VACUUM maintain the oldest btpo.xact among all deleted pages for the index as a whole. It failed to handle all the details surrounding pages that are deleted by the current VACUUM operation correctly (though pages deleted by some previous VACUUM operation were processed correctly). The most immediate problem was that the special area of the page was examined without a buffer pin at one point. More fundamentally, the handling failed to account for the full range of _bt_pagedel() behaviors. For example, _bt_pagedel() sometimes deletes internal pages in passing, as part of deleting an entire subtree with btvacuumpage() caller's page as the leaf level page. The original leaf page passed to _bt_pagedel() might not be the page that it deletes first in cases where deletion can take place. It's unclear how disruptive this bug may have been, or what symptoms users might want to look out for. The issue was spotted during unrelated code review. To fix, push down the logic for maintaining the oldest btpo.xact to _bt_pagedel(). btvacuumpage() is now responsible for pages that were fully deleted by a previous VACUUM operation, while _bt_pagedel() is now responsible for pages that were deleted by the current VACUUM operation (this includes half-dead pages from a previous interrupted VACUUM operation that become fully deleted in _bt_pagedel()). Note that _bt_pagedel() should never encounter an existing deleted page. This commit theoretically breaks the ABI of a stable release by changing the signature of _bt_pagedel(). However, if any third party extension is actually affected by this, then it must already be completely broken (since there are numerous assumptions made in _bt_pagedel() that cannot be met outside of VACUUM). It seems highly unlikely that such an extension actually exists, in any case. Author: Peter Geoghegan Reviewed-By: Masahiko Sawada Discussion: https://postgr.es/m/CAH2-WzkrXBcMQWAYUJMFTTvzx_r4q=pYSjDe07JnUXhe+OZnJA@mail.gmail.com Backpatch: 11-, where the "skip full scan" feature was introduced.
-
Peter Eisentraut authored
-
Michael Paquier authored
The pg_rewind docs currently assert that the state of the target's data directory after rewind is equivalent to the source's data directory. This clarifies the documentation to describe that the base state is further back in time and that the target's data directory will include the current state from the source of any copied blocks since the point of divergence. This commit also improves the section "How It Works": - Describe the update of the pg_control file. - Reorganize the list of files and directories ignored during the rewind. Author: James Coleman Discussion: https://postgr.es/m/CAAaqYe-sgqCos7MXF4XiY8rUPy3CEmaCY9EvfhX-DhPhPBF5_A@mail.gmail.com
-
- 30 Apr, 2020 8 commits
-
-
Peter Geoghegan authored
Add test coverage for the nbtutils.c routines concerned with IndexScans that have native ScalarArrayOpExpr quals. The ScalarArrayOpExpr specialized mark and restore routines, and the "find extreme element" routine now have some test coverage. These functions are probably infrequently exercised by real world queries, so having some coverage seems like a good idea. The mark and restore routines were originally added by a bugfix that came several weeks after the first stable release of Postgres 9.2 (see commit 70bc5833).
-
Peter Geoghegan authored
XLogRegisterBufData() does not copy data pointed to by caller's pointer argument. Oversight in commit 0d861bbb. Author: Peter Eisentraut Reported-By: Peter Eisentraut Discussion: https://postgr.es/m/21800dbe-a13e-22f7-d423-b81db9d249f5@2ndquadrant.com
-
Tom Lane authored
Minor editorial changes in the first two sections; larger ones in the JSON section.
-
Peter Eisentraut authored
see also a00c53b0
-
Peter Eisentraut authored
-
Michael Paquier authored
The libpq parameters ssl{max|min}protocolversion are renamed to use underscores, to become ssl_{max|min}_protocol_version. The related environment variables still use the names introduced in commit ff8ca5fa that added the feature. Per complaint from Peter Eisentraut (this was also mentioned by me in the original patch review but the issue got discarded). Author: Daniel Gustafsson Reviewed-by: Peter Eisentraut, Michael Paquier Discussion: https://postgr.es/m/b319e449-318d-e691-4997-1327e166fcc4@2ndquadrant.com
-
Tom Lane authored
Make the markup a bit less ad-hoc. A function-table cell now contains several <para> units, and we label the ones that contain function signatures with role="func_signature". The CSS or FO stylesheets then key off of that to decide how to set the indentation. A very useful win from this approach is that we can have more than one signature entry per table cell, simplifying the documentation of closely-related operators and functions. This patch mostly just replaces the markup in the tables I converted so far. But I did alter a couple of places where multiple signatures were helpful. Discussion: https://postgr.es/m/5561.1587922854@sss.pgh.pa.us
-
Peter Geoghegan authored
_bt_getbuf() cannot return an invalid buffer. Oversight in commit 2ed5b87f.
-
- 29 Apr, 2020 4 commits
-
-
Michael Paquier authored
Commit 79dfa8af has introduced a check to catch when the minimum protocol version was set higher than the maximum version, however an error was getting generated when both bounds are set even if they are able to work, causing a backend to not use a new SSL context but keep the old one. Author: Daniel Gustafsson Discussion: https://postgr.es/m/14BFD060-8C9D-43B4-897D-D5D9AA6FC92B@yesql.se
-
Alvaro Herrera authored
Checkpointer uses its MyLatch to wake up when a checkpoint request is received. But before commit c6550776 the latch was not used for anything else, so the code could just go to sleep after each loop without rechecking the sleeping condition. That commit added a separate ResetLatch in its code path[1], which can cause a checkpoint to go unnoticed for potentially a long time. Fix by skipping sleep if any checkpoint flags are set. Also add a test to verify this; authored by Kyotaro Horiguchi. [1] CreateCheckPoint -> InvalidateObsoleteReplicationSlots -> ConditionVariableTimeSleep Report and diagnosis by Kyotaro Horiguchi. Co-authored-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Co-authored-by: Álvaro Herrera <alvherre@alvh.no-ip.org> Discussion: https://postgr.es/m/20200408.141956.891237856186513376.horikyota.ntt@gmail.com
-
Peter Eisentraut authored
from 927474ce
-
Alvaro Herrera authored
Lack of these checks could cause visible misbehavior, including assertion failures. This was missed in commit c6550776, whereby restart_lsn becomes invalid when the size limit is exceeded. Also reword some existing error messages, and add errdetail(), so that the reported errors all match in spirit. Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org> Discussion: https://postgr.es/m/20200408.093710.447591748588426656.horikyota.ntt@gmail.com
-
- 28 Apr, 2020 3 commits
-
-
Peter Geoghegan authored
Make sure that we have test coverage of the posting list tuple path within _bt_xid_horizon(). Per off-list complaint from Andres Freund.
-
Peter Eisentraut authored
Some translatable strings have been moved to scanner_yyerror(), so we need to add that, too.
-
Alexander Korotkov authored
pg_statio_all_tables view appears to have a wrong grouping. As the result numbers of toast index blocks read and hit were multiplied to the number of table indexes. This commit fixes the view definition. Backpatching this appears difficult. We don't have a mechanism to patch a system catalog of existing instances in minor upgrade. We can write a release notes instruction to do this manually. But per discussion this is probably not so critical bug for doing such an intrusive fix. Reported-by: Andrei Zubkov Discussion: https://postgr.es/m/CAPpHfdtMYkkNudLMG9G0dxX_B%3Dn5sfKzOyxxrvWYtSicaGW0Lw%40mail.gmail.com
-