Another approach is data masking
via Logical Replication. To get
the masked data this way, you need to set the mask
parameter on the publication. For example:
CREATE PUBLICATION mypublication FOR TABLE people WITH (mask=on);
Please check CREATE PUBLICATION for more details.