Skip to content

Commit

Permalink
Merge branch 'main' into PG-1013-DOC-pg_tde-for-PG17
Browse files Browse the repository at this point in the history
  • Loading branch information
nastena1606 authored Dec 26, 2024
2 parents 3c3caa9 + cddb621 commit f10efea
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 42 deletions.
33 changes: 19 additions & 14 deletions documentation/docs/apt.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ This tutorial shows how to install `pg_tde` with [Percona Distribution for Postg

4. Enable the Percona Distribution for PostgreSQL repository

Percona provides [two repositories](repo-overview.md) for Percona Distribution for PostgreSQL. We recommend enabling the Major release repository to timely receive the latest updates. Since the `tde_heap` access method is still in the experimental stage, the `pg_tde` package is currently available from the experimental repository.
Percona provides [two repositories](repo-overview.md) for Percona Distribution for PostgreSQL. We recommend enabling the Major release repository to timely receive the latest updates.

```{.bash data-prompt="$"}
$ sudo percona-release enable ppg-{{pgversion17}} experimental
$ sudo percona-release enable ppg-{{pgversion17}}
```

6. Update the local cache
Expand All @@ -54,21 +54,26 @@ This tutorial shows how to install `pg_tde` with [Percona Distribution for Postg

## Install `pg_tde`

After all [preconditions](#preconditions) are met, install the extension.
!!! important

1. Install Percona Distribution for PostgreSQL.

Run the following command to install Percona Distribution for PostgreSQL and the required packages:
The `pg_tde` {{release}} extension is a part of the `percona-postgresql-17` package. If you installed a previous version of `pg_tde` from the `percona-postgresql-17-pg-tde` package, do the following:

```bash
sudo apt-get install -y percona-postgresql-17 percona-postgresql-contrib percona-postgresql-server-dev-all
```
* Drop the extension using the `DROP EXTENSION` with `CASCADE` command.

2. Install `pg_tde` packages

```bash
sudo apt-get install percona-postgresql-17-pg-tde
```
<i warning>:material-alert: Warning:</i> The use of the `CASCADE` parameter deletes all tables that were created in the database with `pg_tde` enabled and also all dependencies upon the encrypted table (e.g. foreign keys in a non-encrypted table used in the encrypted one).

```sql
DROP EXTENSION pg_tde CASCADE
```

* Uninstall the `percona-postgresql-17-pg-tde` package.

After all [preconditions](#preconditions) are met, run the following command to install `pg_tde`:


```bash
sudo apt-get install -y percona-postgresql-17
```


## Next step
Expand Down
8 changes: 5 additions & 3 deletions documentation/docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Install `pg_tde` using one of available installation methods:
sudo apt install make gcc postgresql-server-dev-17 libcurl4-openssl-dev
```

2. [Install Percona Distribution for PostgreSQL 17](https://docs.percona.com/postgresql/17/installing.html) or [upstream PostgreSQL 17](https://www.postgresql.org/download/)
2. [Install Percona Distribution for PostgreSQL 17 :octicons-link-external-16:](https://docs.percona.com/postgresql/17/installing.html) or [upstream PostgreSQL 17 :octicons-link-external-16:](https://www.postgresql.org/download/)

3. If PostgreSQL is installed in a non standard directory, set the `PG_CONFIG` environment variable to point to the `pg_config` executable.

Expand All @@ -66,15 +66,17 @@ Install `pg_tde` using one of available installation methods:

The steps below are for the `pg_tde` community version.

You can find Docker images built from the current main branch on [Docker Hub](https://hub.docker.com/r/perconalab/pg_tde). Images are built on top of [postgres:17](https://hub.docker.com/_/postgres) official image.
To run `pg_tde` version for Percona Server for PostgreSQL, [use the Percona Distribution for PostgreSQL Docker image :octicons-link-external-16:](https://docs.percona.com/postgresql/17/docker.html).

You can find Docker images built from the current main branch on [Docker Hub](https://hub.docker.com/r/perconalab/pg_tde). Images are built on top of [postgres:16](https://hub.docker.com/_/postgres) official image.

To run `pg_tde` in Docker, use the following command:

```
docker run --name pg-tde -e POSTGRES_PASSWORD=mysecretpassword -d perconalab/pg_tde
```

It builds and adds `pg_tde` extension to PostgreSQL 17. The `postgresql.conf` contains the required modifications. The `pg_tde` extension is added to `template1` so that all new databases automatically have the `pg_tde` extension loaded.
It builds and adds `pg_tde` extension to PostgreSQL 16. The `postgresql.conf` contains the required modifications. The `pg_tde` extension is added to `template1` so that all new databases automatically have the `pg_tde` extension loaded.

Keys are not created automatically. You must configure a key provider and a principal key for each database where you wish to use encrypted tables. See the instructions in the [Setup](setup.md) section, starting with the 4th point, as the first 3 steps are already completed in the Docker image.

Expand Down
42 changes: 17 additions & 25 deletions documentation/docs/yum.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ This tutorial shows how to install `pg_tde` with [Percona Distribution for Postg

## Preconditions

### Enable / disable modules

For RHEL8/Oracle Linux 8/Rocky Linux 8, disable the ``postgresql`` and ``llvm-toolset``modules:

```bash
sudo dnf module disable postgresql llvm-toolset
```

### Install `percona-release`

You need the `percona-release` repository management tool that enables the desired Percona repository for you.
Expand All @@ -26,34 +18,34 @@ You need the `percona-release` repository management tool that enables the desir
sudo yum -y install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
```

2. Enable the repository
2. Enable the repository.

Percona provides [two repositories](repo-overview.md) for Percona Distribution for PostgreSQL. We recommend enabling the Major release repository to timely receive the latest updates.

```bash
sudo percona-release enable-only ppg-{{pgversion17}} experimental
sudo percona-release enable-only ppg-{{pgversion17}}
```

3. ### For `percona-postgresql{{pgversion}}-devel` package
## Install `pg_tde`

You need to install the `percona-postgresql{{pgversion}}-devel` package when working with pg_tde. This package requires dependencies that are not part of the Distribution, but can be installed from the specific repositories:
!!! important

```
$ sudo dnf config-manager --set-enabled ol9_codeready_builder
```
The `pg_tde` {{release}} extension is a part of the `percona-postgresql17` package. If you installed a previous version of `pg_tde` from the `percona-pg_tde_17` package, do the following:

## Install `pg_tde`
* Drop the extension using the `DROP EXTENSION` with `CASCADE` command.

1. Install Percona Distribution for PostgreSQL 17 and the required packages, run the following command:
<i warning>:material-alert: Warning:</i> The use of the `CASCADE` parameter deletes all tables that were created in the database with `pg_tde` enabled and also all dependencies upon the encrypted table (e.g. foreign keys in a non-encrypted table used in the encrypted one).

```bash
sudo yum -y install percona-postgresql-client-common percona-postgresql-common percona-postgresql-server-dev-all percona-postgresql17 percona-postgresql17-contrib percona-postgresql17-devel percona-postgresql17-libs
```
```sql
DROP EXTENSION pg_tde CASCADE
```

* Uninstall the `percona-pg_tde_17` package.

2. Install `pg_tde` packages

```bash
sudo yum install percona-pg_tde_17
```

```bash
sudo yum -y install percona-postgresql17
```

## Next steps

Expand Down

0 comments on commit f10efea

Please sign in to comment.