* If set to `true` (default), a new key must be unique.
If the provider already stores a key by that name, the function returns an error.
* If set to `false`, an existing principal key will be reused.
* If set to `false`, an existing principal key may be reused.
### pg_tde_set_server_principal_key
@ -227,14 +227,14 @@ The `ensure_new_key` parameter instructs the function how to handle a principal
* If set to `true` (default), a new key must be unique.
If the provider already stores a key by that name, the function returns an error.
* If set to `false`, an existing principal key will be reused.
* If set to `false`, an existing principal key may be reused.
### pg_tde_set_default_principal_key
Creates or rotates the default principal key for the server using the specified key provider.
The default key is automatically used by any database that doesn't have a specific key created the first time an encrypted database object is created.
The default key is automatically used as a principal key by any database that doesn't have a specific principal key created the first time an encrypted database object is created.
@ -10,7 +10,7 @@ For how to enable WAL encryption, refer to the [WAL encryption](setup.md#wal-enc
## Enable extension
Load the `pg_tde` at the start time. The extension requires additional shared memory; therefore, add the `pg_tde` value for the `shared_preload_libraries` parameter and restart the `postgresql`instance.
Load the `pg_tde` at startup time. The extension requires additional shared memory; therefore, add the `pg_tde` value for the `shared_preload_libraries` parameter and restart the `postgresql`cluster.
1. Use the [ALTER SYSTEM :octicons-link-external-16:](https://www.postgresql.org/docs/current/sql-altersystem.html) command from `psql` terminal to modify the `shared_preload_libraries` parameter. This requires superuser privileges.
@ -18,12 +18,12 @@ Load the `pg_tde` at the start time. The extension requires additional shared me
ALTER SYSTEM SET shared_preload_libraries = 'pg_tde';
```
2. Start or restart the `postgresql`instance to apply the changes.
2. Start or restart the `postgresql`cluster to apply the changes.
* On Debian and Ubuntu:
```sh
sudo systemctl restart postgresql.service
sudo systemctl restart postgresql-17
```
* On RHEL and derivatives
@ -38,7 +38,7 @@ Load the `pg_tde` at the start time. The extension requires additional shared me
CREATE EXTENSION pg_tde;
```
By default, the `pg_tde` extension is created for the currently used database. To enable data encryption in other databases, you must explicitly run the `CREATE EXTENSION` command against them.
The `pg_tde` extension is created for the currently used database. To enable data encryption in other databases, you must explicitly run the `CREATE EXTENSION` command against them.
!!! tip
@ -61,13 +61,13 @@ You must do these steps for every database where you have created the extension.
For testing purposes, you can use the PyKMIP server which enables you to set up required certificates. To use a real KMIP server, make sure to obtain the valid certificates issued by the key management appliance.
@ -6,7 +6,7 @@ The steps below describe the default key configuration. This means that the enti
## Enable extension
Load the `pg_tde` at the start time. The extension requires additional shared memory; therefore, add the `pg_tde` value for the `shared_preload_libraries` parameter and restart the `postgresql`instance.
Load the `pg_tde` at startup time. The extension requires additional shared memory; therefore, add the `pg_tde` value for the `shared_preload_libraries` parameter and restart the `postgresql`cluster.
1. Use the [ALTER SYSTEM :octicons-link-external-16:](https://www.postgresql.org/docs/current/sql-altersystem.html) command from `psql` terminal to modify the `shared_preload_libraries` parameter. This requires superuser privileges.
@ -14,12 +14,12 @@ Load the `pg_tde` at the start time. The extension requires additional shared me
ALTER SYSTEM SET shared_preload_libraries = 'pg_tde';
```
2. Start or restart the `postgresql`instance to apply the changes.
2. Start or restart the `postgresql`cluster to apply the changes.
* On Debian and Ubuntu:
```sh
sudo systemctl restart postgresql.service
sudo systemctl restart postgresql-17
```
* On RHEL and derivatives
@ -34,7 +34,7 @@ Load the `pg_tde` at the start time. The extension requires additional shared me
CREATE EXTENSION pg_tde;
```
By default, the `pg_tde` extension is created for the currently used database. To enable data encryption in other databases, you must explicitly run the `CREATE EXTENSION` command against them.
The `pg_tde` extension is created for the currently used database. To enable data encryption in other databases, you must explicitly run the `CREATE EXTENSION` command against them.
4. Enable the `pg_tde` extension automatically for every newly created database. Modify the template `template1` database as follows:
If you no longer wish to use TDE in your deployment, you can remove the `pg_tde` extension. To do that, your user must have the privileges of the superuser or a database owner.
If you no longer wish to use TDE in your deployment, you can remove the `pg_tde` extension. To do that, your user must have the superuser privileges or a database owner.
Here's how to do it:
@ -16,16 +16,16 @@ Here's how to do it:
3. Modify the `shared_preload_libraries` and remove the 'pg_tde' from it. Use the `ALTER SYSTEM` command for this purpose
4. Start or restart the `postgre` instance to apply the changes.
4. Start or restart the `postgresql` cluster to apply the changes.
@ -4,7 +4,7 @@ After you [enabled `pg_tde`](#enable-extension) and restarted the Percona Server
Here's how to do it:
1. Enable WAL level encryption using the `ALTER SYSTEM SET` command. You need the privileges of the superuser to run this command:
1. Enable WAL level encryption using the `ALTER SYSTEM SET` command. You need the superuser privileges to run this command:
```sql
ALTER SYSTEM set pg_tde.wal_encrypt = on;
@ -15,7 +15,7 @@ Here's how to do it:
* On Debian and Ubuntu:
```sh
sudo systemctl restart postgresql.service
sudo systemctl restart postgresql-17
```
* On RHEL and derivatives
@ -35,14 +35,13 @@ Here's how to do it:
For testing purposes, you can use the PyKMIP server which enables you to set up required certificates. To use a real KMIP server, make sure to obtain the valid certificates issued by the key management appliance.
The `ensure_new_key` parameter is set to `true` by default. It ensures that a new key must be unique. If set to `false`, an existing principal key will be reused.