Skip to content

docs: mention reset from parent also resets anonymization #3506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions content/docs/extensions/postgresql-anonymizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ Static masking permanently modifies the original data in your tables. This appro
- Archiving data with sensitive information removed
- Distributing data to third parties

### Branch operations and static masking

When using Neon's branch features with static masking:

- Creating a child branch copies all data as-is from the parent
- Resetting a branch from the parent replaces all branch data with the parent's current state
- In both cases, any previous anonymization is lost and must be reapplied

## Implementation example

<Steps>
Expand Down Expand Up @@ -141,6 +149,7 @@ Note how:
## Limitations

- Neon currently only supports static masking with the `anon` extension
- With static masking, branch reset operations restore original data, requiring anonymization to be run again
- Additional `pg_catalog` functions cannot be declared as `TRUSTED` in Neon's implementation

## Conclusion
Expand Down
6 changes: 5 additions & 1 deletion content/docs/workflows/data-anonymization.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ Create a branch from your `production` branch that you'll anonymize, called `ano
neonctl branch create --project-id <my-project-id> --name anonymized-dev --parent production --psql
```

This creates a branch with an exact copy (snapshot) of your production data, ready for anonymization.
<Admonition type="important">
This creates a branch with an exact copy of your production data. The data is not yet anonymized until you run the anonymization commands below.
</Admonition>

## Enable the `anon` extension

Expand Down Expand Up @@ -162,6 +164,8 @@ You should see the sensitive columns replaced with fake but realistic-looking va
Always double-check that you are on the correct branch before running anonymization.

Never run `anon.init()` and `anon.anonymize_database()` on your parent branch. These functions should only be executed on child branches intended for anonymization. Running them on a parent branch will permanently modify your source data.

If you reset a branch from its parent, all data returns to its original non-anonymized state and you must re-run the entire anonymization process.
</Admonition>

- Generally, you should always back up your data before making any changes. With Neon, you can quickly restore a branch to a previous state using [Instant restore](/docs/introduction/branch-restore) if needed.
Expand Down