model-writtenrun 4051 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Boyu Yang reported a randomly generated SELECT INTO statement that crashed cursor_to_xmlschema when an empty cursor name resolved to the statement's own portal, and supplied a patch checking portal->tupDesc before using it #1.
- Tom Lane confirmed the invalid assumption about portals having result tuple descriptors and examined other SPI_cursor_find and GetPortalByName callers without finding another potential hard failure #2.
- Tom Lane considered filtering non-cursor portals or empty names in SPI_cursor_find, but retained its behavior because callers use it to detect name conflicts and external callers could depend on that behavior #2.
- Tom Lane accepted the local defensive check, requested clearer error wording, and proposed documenting that SPI_cursor_find can return portals without cursor-like properties; this was the thread's final message, before the commits landed #2.
- The patch from #1 landed with revised error reporting and the documentation addition as development commit f73fa5a470; the separately listed candidate db00be6d78 is its REL_11_STABLE counterpart, and the commit messages specify back-patching to all supported branches.