Skip to content

Fractional index storage parameters render with the current culture on the stock Npgsql path #97

Closed

Description

@CaffeinatedCoder

Problem

HasStorageParameter("autovacuum_x", 0.25) on a complex index renders WITH (autovacuum_x=0,25) under de-DE, fr-FR and tr-TR (and Arabic digits under ar-SA) when the index goes through Npgsql's stock generator, i.e. a column-only index. Npgsql's own HasIndex(...).HasStorageParameter("x", 0.25) does the same, so the culture sensitivity is Npgsql's (10.0.x). The package's own generator, used for expression and NULLS-ordered indexes, renders invariantly, and its comment ("Mirrors Npgsql's own formatting: … numbers invariant") is wrong about the stock path.

Impact is probably nil: no built-in btree, gin, gist or brin storage parameter takes a fraction. Scaffolded migrations and snapshots are culture-stable.

Fix

Correct the comment; optionally forward fractional values as invariant strings, and report upstream to Npgsql.

Found by the 5.5.0 consumer probe.

Activity

  1. added
    bug
    severity/low
    package/postgresql
    area/indexes
    on Oct 19, 2026
  2. added this to the 5.5.0 milestone on Oct 20, 2026
  3. CaffeinatedCoder commented on Oct 20, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Upstream behaviour, probed against Npgsql.EntityFrameworkCore.PostgreSQL 10.0.0 (the version the test project restores): NpgsqlMigrationsSqlGenerator renders a double storage parameter as x=0.25 under en-US, x=0,25 under de-DE and tr-TR, and x=0٫25 under ar-SA. Integers are unaffected, and strings are quoted (s='on'). PostgreSQL 18 rejects WITH (fillfactor=0,25) with syntax error at or near "25", so the failure is loud. A quoted value works: fillfactor='70' and autovacuum_vacuum_scale_factor='0.25' are stored as numbers, so HasStorageParameter("x", "0.25") is the workaround, now in docs/postgresql-indexes.md. I found no existing issue on npgsql/efcore.pg. #109 corrects the comment and documents the workaround without rewriting values; the PR says why.

  4. added a commit that references this issue on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/indexesbugpackage/postgresqlseverity/low

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions