summaryrefslogtreecommitdiff
path: root/doc/src/sgml/amcheck.sgml
AgeCommit message (Collapse)Author
2025-04-15doc: Fix typos in documentationDaniel Gustafsson
This fixes a set of typos introduced during the v18 development cycle. Author: Daniel Gustafsson <[email protected]> Reviewed-by: Laurenz Albe <[email protected]> Discussion: https://postgr.es/m/[email protected]
2025-03-29amcheck: Add gin_index_check() to verify GIN indexTomas Vondra
Adds a new function, validating two kinds of invariants on a GIN index: - parent-child consistency: Paths in a GIN graph have to contain consistent keys. Tuples on parent pages consistently include tuples from child pages; parent tuples do not require any adjustments. - balanced-tree / graph: Each internal page has at least one downlink, and can reference either only leaf pages or only internal pages. The GIN verification is based on work by Grigory Kryachko, reworked by Heikki Linnakangas and with various improvements by Andrey Borodin. Investigation and fixes for multiple bugs by Kirill Reshke. Author: Grigory Kryachko <[email protected]> Author: Heikki Linnakangas <[email protected]> Author: Andrey Borodin <[email protected]> Reviewed-By: José Villanova <[email protected]> Reviewed-By: Aleksander Alekseev <[email protected]> Reviewed-By: Nikolay Samokhvalov <[email protected]> Reviewed-By: Andres Freund <[email protected]> Reviewed-By: Tomas Vondra <[email protected]> Reviewed-By: Kirill Reshke <[email protected]> Reviewed-By: Mark Dilger <[email protected]> Reviewed-By: Peter Geoghegan <[email protected]> Discussion: https://postgr.es/m/45AC9B0A-2B45-40EE-B08F-BDCF5739D1E1%40yandex-team.ru
2025-02-21doc: clarify default checksum behavior in non-master branchesBruce Momjian
Also simplify and correct data checksum wording in master now that it is the default. PG 13 did not have the awkward wording. Reported-by: Felix <[email protected]> Reviewed-by: Laurenz Albe Discussion: https://postgr.es/m/[email protected] Backpatch-through: 14
2024-03-05Fix search_path to a safe value during maintenance operations.Jeff Davis
While executing maintenance operations (ANALYZE, CLUSTER, REFRESH MATERIALIZED VIEW, REINDEX, or VACUUM), set search_path to 'pg_catalog, pg_temp' to prevent inconsistent behavior. Functions that are used for functional indexes, in index expressions, or in materialized views and depend on a different search path must be declared with CREATE FUNCTION ... SET search_path='...'. This change was previously committed as 05e1737351, then reverted in commit 2fcc7ee7af because it was too late in the cycle. Preparation for the MAINTAIN privilege, which was previously reverted due to search_path manipulation hazards. Discussion: https://postgr.es/m/[email protected] Discussion: https://postgr.es/m/E1q7j7Y-000z1H-Hr%40gemulon.postgresql.org Discussion: https://postgr.es/m/e44327179e5c9015c8dda67351c04da552066017.camel%40j-davis.com Reviewed-by: Greg Stark, Nathan Bossart, Noah Misch
2023-10-27Teach contrib/amcheck to check the unique constraint violationAlexander Korotkov
Add the 'checkunique' argument to bt_index_check() and bt_index_parent_check(). When the flag is specified the procedures will check the unique constraint violation for unique indexes. Only one heap entry for all equal keys in the index should be visible (including posting list entries). Report an error otherwise. pg_amcheck called with the --checkunique option will do the same check for all the indexes it checks. Author: Anastasia Lubennikova <[email protected]> Author: Pavel Borisov <[email protected]> Author: Maxim Orlov <[email protected]> Reviewed-by: Mark Dilger <[email protected]> Reviewed-by: Zhihong Yu <[email protected]> Reviewed-by: Peter Geoghegan <[email protected]> Reviewed-by: Aleksander Alekseev <[email protected]> Discussion: https://postgr.es/m/CALT9ZEHRn5xAM5boga0qnrCmPV52bScEK2QnQ1HmUZDD301JEg%40mail.gmail.com
2023-01-20Describe each contrib module in its SGML section titleAlvaro Herrera
The original titles only had the module name, which is not very useful when scanning the list. By adding a very brief description to each title, the table of contents becomes friendlier. Also amend the introduction in the "additional modules" appendix, using the word "Extension" more extensively. Nowadays, almost all contrib modules are extensions, so this is also helpful. Author: Karl O. Pinc <[email protected]> Reviewed-by: Brar Piening <[email protected]> Discussion: https://postgr.es/m/[email protected]
2023-01-09Doc: add XML ID attributes to <sectN> and <varlistentry> tags.Tom Lane
This doesn't have any external effect at the moment, but it will allow adding useful link-discoverability features later. Brar Piening, reviewed by Karl Pinc. Discussion: https://postgr.es/m/CAB8KJ=jpuQU9QJe4+RgWENrK5g9jhoysMw2nvTN_esoOU0=a_w@mail.gmail.com
2022-03-11doc: Standardize capitalization of term "hot standby"/"Hot Standby"Michael Paquier
"Hot Standby" was capitalized in a couple of places in the docs, as the style primarily used when it was introduced, but this has not been much respected across the years. Per discussion, it is more natural for the reader to use "hot standby" (aka lower-case only) when in the middle of a sentence, and "Hot standby" (aka capitalized) in a title. This commit adjusts all the places in the docs to be consistent with this choice, rather than applying one style or the other midway. Author: Daniel Westermann Reviewed-by: Kyotaro Horiguchi, Aleksander Alekseev, Robert Treat Discussion: https://postgr.es/m/GVAP278MB093160025A779A1A5788D0EAD2039@GVAP278MB0931.CHEP278.PROD.OUTLOOK.COM
2021-09-28Support amcheck of sequencesPeter Eisentraut
Sequences were left out of the list of relation kinds that verify_heapam knew how to check, though it is fairly trivial to allow them. Doing that, and while at it, updating pg_amcheck to include sequences in relations matched by table and relation patterns. Author: Mark Dilger <[email protected]> Discussion: https://www.postgresql.org/message-id/flat/81ad4757-92c1-4aa3-7bee-f609544837e3%40enterprisedb.com
2021-07-15docs: fix inconsistencies in markup and caseDaniel Gustafsson
Ensure to properly mark up function parameters in text with <parameter>, avoid using <acronym> for terms which aren't acronyms and properly place the ", and" in a value list. The acronym removal is a follow-up to commit fb72a7b8c3 which removed it for minmax-multi. In passing, also fix an incorrectly cased word. Author: Ekaterina Kiryanova <[email protected]> Reviewed-by: Laurenz Albe <[email protected]> Discussion: https://postgr.es/m/[email protected] Backpatch-through: v14
2021-01-17Add documentation chapter about checksumsMagnus Hagander
Data checksums did not have a longer discussion in the docs, this adds a short section with an overview. Extracted from the larger patch for on-line enabling of checksums, which has many more authors and reviewers. Author: Daniel Gustafsson Reviewed-By: Magnus Hagander, Michael Banck (and others through the big patch) Discussion: https://postgr.es/m/[email protected]
2020-12-24Fix typos and grammar in docs and commentsMichael Paquier
This fixes several areas of the documentation and some comments in matters of style, grammar, or even format. Author: Justin Pryzby Discussion: https://postgr.es/m/[email protected]
2020-10-28Doc: clean up verify_heapam() documentation.Tom Lane
I started with the intention of just suppressing a PDF build warning by removing the example output, but ended up doing more: correcting factual errors in the function's signature, moving a bunch of generalized handwaving into the "Using amcheck Effectively" section which seemed a better place for it, and improving wording and markup a little bit. Discussion: https://postgr.es/m/[email protected]
2020-10-22Extend amcheck to check heap pages.Robert Haas
Mark Dilger, reviewed by Peter Geoghegan, Andres Freund, Álvaro Herrera, Michael Paquier, Amul Sul, and by me. Some last-minute cosmetic revisions by me. Discussion: http://postgr.es/m/[email protected]
2020-07-08docs: replace 'master' with 'primary' where appropriate.Andres Freund
Also changed "in the primary" to "on the primary", and added a few "the" before "primary". Author: Andres Freund Reviewed-By: David Steele Discussion: https://postgr.es/m/[email protected]
2020-04-12Doc: Fix contrib/amcheck tip.Peter Geoghegan
Fixes an oversight in commit 20fbb711.
2020-04-11Add contrib/amcheck debug message.Peter Geoghegan
Add a DEBUG1 message indicating that verification of the index structure is underway. Also reduce the severity level of the existing "tree level" debug message to DEBUG1. It should never have been made DEBUG2. Any B-Tree index with more than a couple of levels will generally also have so many pages that the per-page DEBUG2 messages will become completely unmanageable. In passing, add a new "Tip" to the docs that advises users that run into corruption that the debug messages might provide useful additional context.
2020-03-11Improve checking of child pages in contrib/amcheck.Alexander Korotkov
This commit eliminates lossiness in check for missing parent downlinks in B-tree. Instead of collecting lossy bitmap, we check for missing downlinks while visiting child pages referenced by downlinks of target level. We traverse from previous child page to the subsequent child page by right links. Intermediate pages are candidates to have lost parent downlinks. Also this commit introduces matching of child high key to the pivot key of it's parent. Discussion: https://postgr.es/m/CAPpHfduoF-c4RhOyOm%3D4-Y367%2B8txq9Q6iM_ty0OYc8si1Abww%40mail.gmail.com Author: Alexander Korotkov Reviewed-by: Peter Geoghegan
2019-09-08doc: Clean up title case usePeter Eisentraut
Note: Following existing practice, titles of formalpara and step are not titlecased.
2019-03-20Allow amcheck to re-find tuples using new search.Peter Geoghegan
Teach contrib/amcheck's bt_index_parent_check() function to take advantage of the uniqueness property of heapkeyspace indexes in support of a new verification option: non-pivot tuples (non-highkey tuples on the leaf level) can optionally be re-found using a new search for each, that starts from the root page. If a tuple cannot be re-found, report that the index is corrupt. The new "rootdescend" verification option is exhaustive, and can therefore make a call to bt_index_parent_check() take a lot longer. Re-finding tuples during verification is mostly intended as an option for backend developers, since the corruption scenarios that it alone is uniquely capable of detecting seem fairly far-fetched. For example, "rootdescend" verification is much more likely to detect corruption of the least significant byte of a key from a pivot tuple in the root page of a B-Tree that already has at least three levels. Typically, only a few tuples on a cousin leaf page are at risk of "getting overlooked" by index scans in this scenario. The corrupt key in the root page is only slightly corrupt: corrupt enough to give wrong answers to some queries, and yet not corrupt enough to allow the problem to be detected without verifying agreement between the leaf page and the root page, skipping at least one internal page level. The existing bt_index_parent_check() checks never cross more than a single level. Author: Peter Geoghegan Reviewed-By: Heikki Linnakangas Discussion: https://postgr.es/m/CAH2-Wz=yTWnVu+HeHGKb2AGiADL9eprn-cKYAto4MkKOuiGtRQ@mail.gmail.com
2018-08-08Doc: Correct description of amcheck example query.Peter Geoghegan
The amcheck documentation incorrectly claimed that its example query verifies every catalog index in the database. In fact, the query only verifies the 10 largest indexes (as determined by pg_class.relpages). Adjust the description accordingly. Backpatch: 10-, where contrib/amcheck was introduced.
2018-04-25Add missing and dangling downlink checks to amcheckTeodor Sigaev
When bt_index_parent_check() is called with the heapallindexed option, allocate a second Bloom filter to fingerprint block numbers that appear in the downlinks of internal pages. Use Bloom filter probes when walking the B-Tree to detect missing downlinks. This can detect subtle problems with page deletion/VACUUM, such as corruption caused by the bug just fixed in commit 6db4b499. The downlink Bloom filter is bound in size by work_mem. Its optimal size is typically far smaller than that of the regular heapallindexed Bloom filter, especially when the index has high fan-out. Author: Peter Geoghegan Reviewer: Teodor Sigaev Discussion: https://postgr.es/m/CAH2-WznUzY4fWTjm1tBB3JpVz8cCfz7k_qVp5BhuPyhivmWJFg@mail.gmail.com
2018-04-01Add amcheck verification of heap relations belonging to btree indexes.Andres Freund
Add a new, optional, capability to bt_index_check() and bt_index_parent_check(): check that each heap tuple that should have an index entry does in fact have one. The extra checking is performed at the end of the existing nbtree checks. This is implemented by using a Bloom filter data structure. The implementation performs set membership tests within a callback (the same type of callback that each index AM registers for CREATE INDEX). The Bloom filter is populated during the initial index verification scan. Reusing the CREATE INDEX infrastructure allows the new verification option to automatically benefit from the heap consistency checks that CREATE INDEX already performs. CREATE INDEX does thorough sanity checking of HOT chains, so the new check actually manages to detect problems in heap-only tuples. Author: Peter Geoghegan Reviewed-By: Pavan Deolasee, Andres Freund Discussion: https://postgr.es/m/CAH2-Wzm5VmG7cu1N-H=nnS57wZThoSDQU+F5dewx3o84M+jY=g@mail.gmail.com
2017-11-23Convert documentation to DocBook XMLPeter Eisentraut
Since some preparation work had already been done, the only source changes left were changing empty-element tags like <xref linkend="foo"> to <xref linkend="foo"/>, and changing the DOCTYPE. The source files are still named *.sgml, but they are actually XML files now. Renaming could be considered later. In the build system, the intermediate step to convert from SGML to XML is removed. Everything is build straight from the source files again. The OpenSP (or the old SP) package is no longer needed. The documentation toolchain instructions are updated and are much simpler now. Peter Eisentraut, Alexander Lakhin, Jürgen Purtz
2017-10-17Don't use SGML empty tagsPeter Eisentraut
For DocBook XML compatibility, don't use SGML empty tags (</>) anymore, replace by the full tag name. Add a warning option to catch future occurrences. Alexander Lakhin, Jürgen Purtz
2017-06-18Documentation spell checking and markup improvementsPeter Eisentraut
2017-03-10Add amcheck extension to contrib.Andres Freund
This is the beginning of a collection of SQL-callable functions to verify the integrity of data files. For now it only contains code to verify B-Tree indexes. This adds two SQL-callable functions, validating B-Tree consistency to a varying degree. Check the, extensive, docs for details. The goal is to later extend the coverage of the module to further access methods, possibly including the heap. Once checks for additional access methods exist, we'll likely add some "dispatch" functions that cover multiple access methods. Author: Peter Geoghegan, editorialized by Andres Freund Reviewed-By: Andres Freund, Tomas Vondra, Thomas Munro, Anastasia Lubennikova, Robert Haas, Amit Langote Discussion: CAM3SWZQzLMhMwmBqjzK+pRKXrNUZ4w90wYMUWfkeV8mZ3Debvw@mail.gmail.com