[go: up one dir, main page]

Skip to content

Duplicated data after dump

Hello,

I try to use the anon on a Odoo database (pg16).

Following https://postgresql-anonymizer.readthedocs.io/en/stable/anonymous_dumps/

I create a dumper role, apply some masks and dump with the provided command.

The data are anonymized, but I notice that a table is duplicated wich break my database :

select from ir_actions group by id having count(*) > 1;
--
(503 lines)

If y do the same dump without the role, there is no problem, of course the data are not anomymized

pg_dump database --no-security-labels --extension plpgsql --file=db.sql
select  from ir_actions group by id having count(*) > 1;
(0 line)

If I try to dump without rules, but the extension activated I have the same problem :

# Load 

ALTER DATABASE foo SET session_preload_libraries = 'anon';
CREATE EXTENSION anon;
SELECT anon.init();
 # check rules 
SELECT * FROM anon.pg_masking_rules;
(0 ligne)
# dump
pg_dump odoo --user anon_dumper -W  --no-security-labels  --extension plpgsql --file=anon.sql

Result :

select  from ir_actions group by id having count(*) > 1;
(503 lines)

More info about the duplicated table

\d+ ir_actions


Index :
    "ir_actions_pkey" PRIMARY KEY, btree (id)
    "ir_actions_path_unique" UNIQUE CONSTRAINT, btree (path)
Contraintes de clés étrangères :
    "ir_actions_binding_model_id_fkey" FOREIGN KEY (binding_model_id) REFERENCES ir_model(id) ON DELETE CASCADE
    "ir_actions_create_uid_fkey" FOREIGN KEY (create_uid) REFERENCES res_users(id) ON DELETE SET NULL
    "ir_actions_write_uid_fkey" FOREIGN KEY (write_uid) REFERENCES res_users(id) ON DELETE SET NULL
Tables enfant: ir_act_client,
               ir_act_report_xml,
               ir_act_server,
               ir_act_url,
               ir_act_window
Méthode d'accès : heap

Do you have any solution ?

Thanks.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information