Skip to content
This repository was archived by the owner on Aug 17, 2025. It is now read-only.
This repository was archived by the owner on Aug 17, 2025. It is now read-only.

Field querying does not work as expected with integers and some operations #226

@georgifarashev

Description

@georgifarashev

If field querying is used with numbers and operations lt or gt the comparison is done alphabetically.
For example: col1 gt 12 in a table containing rows with col1 from 1 to 14 will return result with col1 from 2 to 9, 13 and 14 instead of just 13 and 14.
The problematic code seems to be here:

clause := fmt.Sprintf("%s.%s::text %s %s", baseTableName, option.LeftOp, sqlOperation, rightOpBindVar)

and more specifically the ::text.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions