Skip to content

[BUG] diff command generates superflous ordersΒ #246

@palevi67

Description

@palevi67

Describe the bug**

When I run the same pg-schema-diff diff command several times, I get different outputs, including some orders wich updates an already updated table.

Expected behavior**

Results should be the same no matter how many times you repeat the diff command. Also, there should be no superflous orders.

To Reproduce

Run an order similar to this one several times:

pg-schema-diff diff --to-dir=/opt/spark2/spark2-ddl.sql --from-dsn="postgres://SPARK2@localhost/spark2" --disable-plan-validation

And you might get some surplus orders like this one (in addition to the right ones)

ALTER TABLE "public"."zonas" ALTER COLUMN "descripcion" SET DATA TYPE public.citext COLLATE "pg_catalog"."default" using "descripcion"::public.citext;

I'm sure this column has no changes and therefore this is an superflous order.

Context

pg-schema-diff version: v1.0.2

pg-schema-diff usage: CLI

Postgres version: 16.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions