Loading service/lists.md +130 −128 Original line number Original line Diff line number Diff line Loading @@ -259,10 +259,11 @@ database directly, as mailman doesn't offer any similar compliance mechanism. In this example, we'll pretend to handle a request to redact the name "Foo Bar" In this example, we'll pretend to handle a request to redact the name "Foo Bar" and an associated email address, "foo@bar.com": and an associated email address, "foo@bar.com": 0. login to `lists-01`, run `sudo -u postgres psql` and `\c mailman3` 0. Login to `lists-01`, run `sudo -u postgres psql` and `\c mailman3` 1. backup the affected database rows to temporary tables: 1. Backup the affected database rows to temporary tables: ``` CREATE TEMP TABLE hyperkitty_attachment_redact AS CREATE TEMP TABLE hyperkitty_attachment_redact AS SELECT * FROM hyperkitty_attachment SELECT * FROM hyperkitty_attachment WHERE WHERE Loading @@ -289,8 +290,9 @@ and an associated email address, "foo@bar.com": CREATE TEMP TABLE user_redact AS CREATE TEMP TABLE user_redact AS SELECT * from "user" SELECT * from "user" WHERE display_name = 'Foo Bar'; WHERE display_name = 'Foo Bar'; ``` 2. begin the transaction 2. Run the actual modifications inside a transaction: BEGIN; BEGIN; Loading Loading @@ -381,13 +383,13 @@ and an associated email address, "foo@bar.com": SET display_name = '[REDACTED]' SET display_name = '[REDACTED]' WHERE display_name = 'Foo Bar'; WHERE display_name = 'Foo Bar'; 3. look around the modified tables, do `COMMIT;` if all good, otherwise `ROLLBACK;` 3. Look around the modified tables, do `COMMIT;` if all good, otherwise `ROLLBACK;` 4. ending the `psql` session discards the temporary tables, so keep it open 4. Ending the `psql` session discards the temporary tables, so keep it open 5. look at the archives if everything is ok 5. Look at the archives if everything is ok 6. end the `psql` session 6. End the `psql` session To rollback changes after the transaction has been committed to the database, To rollback changes after the transaction has been committed to the database, using the temporary tables: using the temporary tables: Loading Loading
service/lists.md +130 −128 Original line number Original line Diff line number Diff line Loading @@ -259,10 +259,11 @@ database directly, as mailman doesn't offer any similar compliance mechanism. In this example, we'll pretend to handle a request to redact the name "Foo Bar" In this example, we'll pretend to handle a request to redact the name "Foo Bar" and an associated email address, "foo@bar.com": and an associated email address, "foo@bar.com": 0. login to `lists-01`, run `sudo -u postgres psql` and `\c mailman3` 0. Login to `lists-01`, run `sudo -u postgres psql` and `\c mailman3` 1. backup the affected database rows to temporary tables: 1. Backup the affected database rows to temporary tables: ``` CREATE TEMP TABLE hyperkitty_attachment_redact AS CREATE TEMP TABLE hyperkitty_attachment_redact AS SELECT * FROM hyperkitty_attachment SELECT * FROM hyperkitty_attachment WHERE WHERE Loading @@ -289,8 +290,9 @@ and an associated email address, "foo@bar.com": CREATE TEMP TABLE user_redact AS CREATE TEMP TABLE user_redact AS SELECT * from "user" SELECT * from "user" WHERE display_name = 'Foo Bar'; WHERE display_name = 'Foo Bar'; ``` 2. begin the transaction 2. Run the actual modifications inside a transaction: BEGIN; BEGIN; Loading Loading @@ -381,13 +383,13 @@ and an associated email address, "foo@bar.com": SET display_name = '[REDACTED]' SET display_name = '[REDACTED]' WHERE display_name = 'Foo Bar'; WHERE display_name = 'Foo Bar'; 3. look around the modified tables, do `COMMIT;` if all good, otherwise `ROLLBACK;` 3. Look around the modified tables, do `COMMIT;` if all good, otherwise `ROLLBACK;` 4. ending the `psql` session discards the temporary tables, so keep it open 4. Ending the `psql` session discards the temporary tables, so keep it open 5. look at the archives if everything is ok 5. Look at the archives if everything is ok 6. end the `psql` session 6. End the `psql` session To rollback changes after the transaction has been committed to the database, To rollback changes after the transaction has been committed to the database, using the temporary tables: using the temporary tables: Loading