rheinwerk-verlag / pganonymize

A commandline tool for anonymizing PostgreSQL databases
http://pganonymize.readthedocs.io/
Other
41 stars 26 forks source link

compatibility with "GENERATED ALWAYS" columns #51

Closed yeoldegrove closed 11 months ago

yeoldegrove commented 11 months ago

It would be great to have compatibility with https://www.postgresql.org/docs/current/ddl-generated-columns.html. At the moment, when I name a generated column in the yml file, I get the following error:

- members:
    primary_key: uuid
    chunk_size: 5000
    fields:
     - name:
        provider:
          name: md5
     - firstname:
        provider:
          name: fake.first_name
     - lastname:
        provider:
          name: fake.last_name

psycopg2.errors.GeneratedAlways: column "name" can only be updated to DEFAULT
DETAIL:  Column "name" is a generated column.

This is of course, because generated columns can only be updated in a certain way. Maybe a generated provider would be a nice addition?

yeoldegrove commented 11 months ago

nevermind, I just realized the generated columns are updated automatically.