Skip to content

Reworded the DELETE (previous DROP) key function in Architecture chapter #354

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 6 commits into from
May 28, 2025
Merged
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
20 changes: 14 additions & 6 deletions contrib/pg_tde/documentation/docs/architecture/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,23 @@ With `pg_tde.inherit_global_key_providers`, it is also possible to set up a defa

With this feature, it is possible for the entire database server to easily use the same principal key for all databases, completely disabling multi-tenency.

A default key can be managed with the following functions:
#### Manage a default key

```sql
pg_tde_set_default_key_using_global_key_provider('key-name', 'provider-name', 'true/false')
```
You can manage a default key with the following functions:

* `pg_tde_set_default_key_using_global_key_provider('key-name','provider-name','true/false')`
* `pg_tde_delete_principal_key()`

!!! note
`pg_tde_delete_principal_key()` is only possible if there's no table currently using the default principal key.
Changing the default principal key will rotate the encryption of internal keys for all databases using the current default principal key.

#### Deleting the key

`DROP` is only possible if there's no table currently using the default principal key.
The `pg_tde_delete_principal_key()` function removes the principal key for the current database. If the current database has any encrypted tables, and there isn’t a default principal key configured, it reports an error instead. If there are encrypted tables, but there’s also a global default principal key, internal keys will be encrypted with the default key.

Changing the default principal key will rotate the encryption of internal keys for all databases using the current default principal key.
!!! note
WAL keys **cannot** be deleted, as server keys are managed separately.

### Current key details

Expand Down
Loading