Over in the "Document atthasmissing default optimization avoids verification table scan" thread David Johnston (who I've cc'd) suggested that my goals might be better implemented with a simple restructuring of the Notes section of the ALTER TABLE docs. I think this is also along the lines of Tom Lane's suggestion of a "unified discussion", but I've chosen for now (and simplicity's sake) not to break this into an entirely new page. If reviewers feel that is warranted at this stage, I can do that, but it seems to me that for now this improves the structure and sets us up for such a future page but falls short of sufficient content to move into its own page.
One question on the changes: the current docs say "when attaching a new partition it may be scanned to verify that existing rows meet the partition constraint". The word "may" there seems to suggest there may also be occasions where scans are not needed, but no examples of such cases are present. I'm not immediately aware of such a case. Are these constraints always validated? If not, in which cases can such a scan be skipped? I've also incorporated the slight correction in "Correct docs re: rewriting indexes when table rewrite is skipped" [2] here, and will rebase this patch if that gets committed. Thanks, James Coleman 1: https://www.postgresql.org/message-id/CAKFQuwZyBaJjNepdTM3kO8PLaCpRdRd8%2BmtLT8QdE73oAsGv8Q%40mail.gmail.com 2: https://www.postgresql.org/message-id/CAAaqYe90Ea3RG%3DA7H-ONvTcx549-oQhp07BrHErwM%3DAyH2ximg%40mail.gmail.com
v1-0001-Restructure-ALTER-TABLE-notes-to-clarify-table-re.patch
Description: Binary data