Skip to content

fix(pg): use RETURNS TABLE column name for function RTE#136

Merged
rebelice merged 1 commit into
mainfrom
codex/pg-returns-table-rte-column-name
May 12, 2026
Merged

fix(pg): use RETURNS TABLE column name for function RTE#136
rebelice merged 1 commit into
mainfrom
codex/pg-returns-table-rte-column-name

Conversation

@rebelice
Copy link
Copy Markdown
Collaborator

Summary

  • Match PostgreSQL scalar function RTE alias behavior by preferring a single named OUT/INOUT/TABLE result parameter.
  • Preserve scalar target-list behavior for SELECT f(...) while fixing SELECT * FROM f(...) for single-column RETURNS TABLE functions.
  • Add regression coverage for no alias, RTE alias, explicit column alias, and scalar-call cases.

Test Plan

  • go test ./pg/catalog -run TestAnalyzeReturnsTableSingleColumnFunctionNames -count=1 -v
  • go test ./pg/catalog -count=1

@rebelice rebelice merged commit b232d2d into main May 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant