Question: `statement` executes once and applied to all rows on a table?
NominalTrajectory opened this issue · 2 comments
NominalTrajectory commented
Hi,
I'm using this project in combination with https://gitlab.com/dalibo/postgresql_anonymizer
And I have this in my .pgsync.yml
:
data_rules:
# Sanitize Bank Accounts
bank_accounts.iban:
statement: "(SELECT anon.fake_iban() AS iban)"
What I see in the end is that the same output is applied to all rows:
Is it possible to make the statement execute for each row?
ankane commented
Hi @NominalTrajectory, this is due to the statement being a subquery. Instead, use:
statement: "anon.fake_iban()"
NominalTrajectory commented
@ankane Ah, that worked. Thanks a lot!