pgschema icon indicating copy to clipboard operation
pgschema copied to clipboard

Bug: pgschema is not detecting changes in numeric precision

Open marioloko opened this issue 8 months ago • 0 comments

pgschema does not detect changes of type when precision or scale is modified.

I have a table as follows:

CREATE TABLE IF NOT EXISTS "public"."my_table" (
    "id"                  "uuid" DEFAULT "gen_random_uuid"() PRIMARY KEY,
    "amount"         NUMERIC(18,6) NOT NULL DEFAULT 0
);

And I changed it to:

CREATE TABLE IF NOT EXISTS "public"."my_table" (
    "id"                  "uuid" DEFAULT "gen_random_uuid"() PRIMARY KEY,
    "amount"         NUMERIC(20,6) NOT NULL DEFAULT 0
);

The change is: NUMERIC(18,6) to NUMERIC(20,6).

They are two different types and a change to the column type should be done, however pgschema detects both as the same types and as consequence no change is added to plan.

marioloko avatar Mar 22 '26 10:03 marioloko