model-writtenrun 7909 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Justin Pryzby reported that restoring a child partition without its parent failed because pg_restore submitted CREATE TABLE and ATTACH together, allowing the ATTACH error to roll back table creation #1.
- Justin proposed explicit BEGIN/COMMIT around table creation in #2 and updated the expected test output in #3.
- Alvaro Herrera questioned compatibility with pg_restore -1 in #4; Justin confirmed that the patch would prematurely commit the restore transaction and supplied two alternatives involving SQL parsing and NUL-separated command strings in #5.
- Tom Lane rejected those alternatives in #6 because ExecuteSimpleCommands could not safely parse arbitrary SQL and the string representation abused PQExpBuffer; he proposed a separate ATTACH archive entry that users could omit with pg_restore -L.
- Justin implemented the separate TABLE ATTACH object and its dependencies in #7, then corrected a bitmask precedence bug identified by Tom in #8 and added comments in #9.
- Tom committed #9 as 9a4c0e36fb, with cosmetic changes and local corrections including the child table's owner on the archive entry, as explained in #10.
- The same review exposed an existing INDEX ATTACH ownership omission, which Tom fixed separately in 9eabfe300a and backpatched to PostgreSQL 11; the fix ensures the attachment command runs under the appropriate role when using session authorization #10.
- Tom also raised an unresolved concern about attachment selection flags during selective dumps, although his testing did not reproduce a failure #10.
- With both changes committed, Justin's final message asked for release-note coverage because TABLE ATTACH entries alter pg_restore -l output and must be selected explicitly for equivalent pg_restore -L behavior; no answer appears in the thread #11.