Skip to content

Handle human readable number casting in general #1309

@mathemancer

Description

@mathemancer

Problem

Currently, casting from textual types (e.g., TEXT) to numbers relies on the default PostgreSQL number handling. This will be solved for the NUMERIC type once #1107 is solved, but we should also handle other number types.

Proposed solution

We should write custom logic to allow handling casting more strings to number types.

  • Casting to number types with decimals should use the same (or very similar) logic to casting to NUMERIC.
  • Casting to number types without decimals (e.g., INTEGER) should use a subset of that logic that handles only grouping separators.

Additional context

This was originally inspired by the custom casting work for money types. See #1137 . This issue should complete the work begun when solving #1107 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects: architectureImprovements or additions to architecturereadyReady for implementationtemp: re-labelThis issue's labels need to be double checked - Oct 2025 backlog grooming.type: enhancementwork: db-layerRelated to SQL or PL/pgSQL

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions