Skip to content

feat(c/driver/postgresql): expose numeric result type modifiers - #4798

Merged
lidavidm merged 5 commits into
apache:mainfrom
tdminc:postgresql-numeric-typmod
Oct 5, 2026
Merged

lidavidm merged 5 commits into
apache:mainfrom
tdminc:postgresql-numeric-typmod

Conversation

@besquared

@besquared besquared commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Carry libpq PQfmod into numeric result-field metadata as POSTGRESQL:typmod.

Closes #4797.

Assisted-by: OpenAI Codex

@besquared
besquared requested a review from lidavidm as a code owner September 22, 2026 03:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

All reviewed paths are covered, with no unresolved issues.

Review effort: Balanced
Findings: None

What changed in this PR

Exposes PostgreSQL numeric type modifiers in Arrow result metadata without changing numeric value representation.

Changes:

  • Propagates PQfmod through COPY, non-COPY, and schema paths.
  • Emits and documents POSTGRESQL:typmod.
  • Adds unit and integration coverage.
File Description
docs/​source/​driver/​postgresql.rst Documents numeric typmod metadata.
c/​driver/​postgresql/​result_reader.cc Propagates modifiers for non-COPY results.
c/​driver/​postgresql/​result_helper.h Exposes PQfmod.
c/​driver/​postgresql/​result_helper.cc Preserves modifiers during type resolution.
c/​driver/​postgresql/​postgresql_test.cc Tests COPY, non-COPY, schema, and empty-result paths.
c/​driver/​postgresql/​postgres_type.h Stores and emits numeric typmod metadata.
c/​driver/​postgresql/​postgres_type_test.cc Tests metadata generation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clean up this prose? Stuff like "It does not add modifiers to parameter schemas or catalog discovery." is rather unnecessary; I don't need a full log of the AI's thought process baked into the docs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather have just a section briefly listing the metadata keys we attach and describing each one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry yeah there's a bunch of slop in here, I wasn't sure this would even come to the attention of folks so I hadn't looked over it closely yet. I'll go back through it as soon as I get some time to return to it.

@lidavidm
lidavidm merged commit 2dd3d10 into apache:main Oct 5, 2026
120 of 121 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.

feat(c/driver/postgresql): expose numeric result type modifiers

3 participants