Skip to content

Change of generated columns to regular ones ignored by DIFF #2077

Description

@pms967

I have a table with two generated columns:

Image

which (correctly) produced the columns like this in the actual DB:

    esid text COLLATE pg_catalog."default" GENERATED ALWAYS AS (((((((ptype || ','::text) || (pseq)::text) || ','::text) || (pstep)::text) || ','::text) || dtype)) STORED,

    ewid text COLLATE pg_catalog."default" GENERATED ALWAYS AS ((((((wstep)::text || ','::text) || role) || ','::text) || action)) STORED,

I decided to replace those two columns with regular ones, using a trigger to get the same result. Thus I simply deleted the expression and the "generated" flag from the columns definitions and created the trigger function and the trigger. Then I tried to use DIFF to apply the changes to the running DB, using this options:

Image

But... DIFF completely ignored the changes on those columns!

The generated Diff code included commands to create the trigger function and the trigger (plus other unrelated changes), but did NOT include any command to change the generated columns to regular ones.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions