model-writtenrun 4453 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Fei Changhong reported that creating an identity column with an explicit sequence name could produce an unrecognized-node-type error when a ddl_command_end event trigger collected the command, and supplied an assertion-enabled reproducer in #1.
- Fei Changhong traced the failure to generateSerialExtraStmts() freeing the sequence-options list while Constraint.options still pointed to it, causing a later copyObject operation to access freed memory #1.
- David Rowley considered copying the list at the caller, unconditionally inside generateSerialExtraStmts(), or immediately before deletion; his attached patch chose the last option as the smallest necessary fix #2.
- David Rowley committed a revised version of #2 as 6c3b697b19, moving the copy to function entry so the generated command always receives its own list and backpatching the fix through PostgreSQL 11.
- David Rowley announced that the unconditional-copy approach had landed because it better protected against future modifications to the input list, and said the fix would appear in PostgreSQL 15.3, closing the thread with the issue resolved #3.