Skip to content

Commit 57eefad

Browse files
committed
Clean up code blocks in our documentation
- Fix whitespace - Make sure to use the right languages - Do not wrap short SQL queries unnecessarily - Add missing end of code block - Add missing semicolon to SQL query
1 parent b2bb77c commit 57eefad

File tree

11 files changed

+44
-41
lines changed

11 files changed

+44
-41
lines changed

contrib/pg_tde/documentation/CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ When you work, you should periodically run tests to check that your changes don
5454

5555
To run the tests, use the following command:
5656

57-
```
57+
```sh
5858
source ci_scripts/setup-keyring-servers.sh
5959
ci_scripts/make-test.sh all
6060
```
@@ -148,6 +148,7 @@ To verify how your changes look, generate the static site with the documentation
148148
cd contrib/pg_tde/documentation
149149
docker run --rm -v $(pwd):/docs perconalab/pmm-doc-md mkdocs build
150150
```
151+
151152
If Docker can't find the image locally, it first downloads the image, and then runs it to build the documentation.
152153

153154
3. Go to the ``site`` directory and open the ``index.html`` file to see the documentation.

contrib/pg_tde/documentation/docs/apt.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,31 @@ Check the [list of supported platforms](install.md#__tabbed_1_1) before continui
2121
Install them with the following command:
2222

2323
```{.bash data-prompt="$"}
24-
sudo apt-get install -y wget gnupg2 curl lsb-release
24+
sudo apt-get install -y wget gnupg2 curl lsb-release
2525
```
2626

2727
2. Fetch the `percona-release` package
2828

2929
```{.bash data-prompt="$"}
30-
sudo wget https://repo.percona.com/apt/percona-release_latest.generic_all.deb
30+
sudo wget https://repo.percona.com/apt/percona-release_latest.generic_all.deb
3131
```
3232

3333
3. Install `percona-release`
3434

3535
```{.bash data-prompt="$"}
36-
sudo dpkg -i percona-release_latest.generic_all.deb
36+
sudo dpkg -i percona-release_latest.generic_all.deb
3737
```
3838

3939
4. Enable the Percona Distribution for PostgreSQL repository
4040

4141
```{.bash data-prompt="$"}
42-
sudo percona-release enable-only ppg-{{pgversion17}}
42+
sudo percona-release enable-only ppg-{{pgversion17}}
4343
```
4444

4545
6. Update the local cache
4646

4747
```{.bash data-prompt="$"}
48-
sudo apt-get update
48+
sudo apt-get update
4949
```
5050

5151
## Install pg_tde {.power-number}
@@ -59,15 +59,15 @@ Check the [list of supported platforms](install.md#__tabbed_1_1) before continui
5959
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).
6060

6161
```sql
62-
DROP EXTENSION pg_tde CASCADE;
62+
DROP EXTENSION pg_tde CASCADE;
6363
```
6464

6565
2. Uninstall the `percona-postgresql-17-pg-tde` package.
6666

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

6969
```{.bash data-prompt="$"}
70-
sudo apt-get install -y percona-postgresql-17
70+
sudo apt-get install -y percona-postgresql-17
7171
```
7272

7373
## Next steps

contrib/pg_tde/documentation/docs/architecture/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ To change a provider from a command line, `pg_tde` provides the `pg_tde_change_k
227227

228228
This tool work similarly to the above functions, with the following syntax:
229229

230-
```bash
230+
```sh
231231
pg_tde_change_key_provider <dbOid> <providerType> ... details ...
232232
```
233233

contrib/pg_tde/documentation/docs/command-line-tools/pg-tde-change-key-provider.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ To modify the key provider configuration, specify all parameters depending on th
1616

1717
The general syntax is as follows:
1818

19-
```bash
19+
```sh
2020
pg_tde_change_key_provider [-D <datadir>] <dbOid> <provider_name> <new_provider_type> <provider_parameters...>
2121
```
2222

@@ -29,7 +29,7 @@ pg_tde_change_key_provider [-D <datadir>] <dbOid> <provider_name> <new_provider_
2929

3030
Depending on the provider type, the additional parameters are:
3131

32-
```bash
32+
```sh
3333
pg_tde_change_key_provider [-D <datadir>] <dbOid> <provider_name> file <filename>
3434
pg_tde_change_key_provider [-D <datadir>] <dbOid> <provider_name> vault-v2 <url> <mount_path> <token_path> [<ca_path>]
3535
pg_tde_change_key_provider [-D <datadir>] <dbOid> <provider_name> kmip <host> <port> <cert_path> <key_path> [<ca_path>]

contrib/pg_tde/documentation/docs/contribute.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ When you work, you should periodically run tests to check that your changes don
5454

5555
To run the tests, use the following command:
5656

57-
```
57+
```sh
5858
source ci_scripts/setup-keyring-servers.sh
5959
ci_scripts/make-test.sh all
6060
```
@@ -108,6 +108,7 @@ The steps are the following:
108108

109109
```sh
110110
git clone --recursive [email protected]:<your-name>/postgres.git
111+
```
111112

112113
3. Change the directory to `contrib/pg_tde` and add the remote upstream repository:
113114

contrib/pg_tde/documentation/docs/functions.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ SELECT pg_tde_add_database_key_provider_kmip(
117117
'/path_to/client_key.pem',
118118
'/path_to/server_certificate.pem'
119119
);
120+
120121
SELECT pg_tde_add_global_key_provider_kmip(
121122
'provider-name',
122123
'kmip-addr',
@@ -138,6 +139,7 @@ SELECT pg_tde_change_database_key_provider_kmip(
138139
'/path_to/client_key.pem',
139140
'/path_to/server_certificate.pem'
140141
);
142+
141143
SELECT pg_tde_change_global_key_provider_kmip(
142144
'provider-name',
143145
'kmip-addr',
@@ -261,6 +263,7 @@ SELECT pg_tde_set_key_using_database_key_provider(
261263
'provider-name'
262264
);
263265
```
266+
264267
### pg_tde_set_key_using_global_key_provider
265268

266269
Sets or rotates the global principal key using the specified global key provider and the key name. This key is used for global settings like WAL encryption.

contrib/pg_tde/documentation/docs/how-to/decrypt.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ The output returns `f` meaning that the table is no longer encrypted.
2727
Alternatively, you can create a new not encrypted table with the same structure and data as the initial table. For example, the original encrypted table is `EncryptedCustomers`. Use the following command to create a new table `Customers`:
2828

2929
```sql
30-
CREATE TABLE Customers AS
31-
SELECT * FROM EncryptedCustomers;
30+
CREATE TABLE Customers AS SELECT * FROM EncryptedCustomers;
3231
```
3332

3433
The new table `Customers` inherits the structure and the data from `EncryptedCustomers`.

contrib/pg_tde/documentation/docs/how-to/multi-tenant-setup.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Load the `pg_tde` at startup time. The extension requires additional shared memo
1717

1818
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.
1919

20-
```
20+
```sql
2121
ALTER SYSTEM SET shared_preload_libraries = 'pg_tde';
2222
```
2323

@@ -37,7 +37,7 @@ Load the `pg_tde` at startup time. The extension requires additional shared memo
3737

3838
3. Create the extension using the [CREATE EXTENSION :octicons-link-external-16:](https://www.postgresql.org/docs/current/sql-createextension.html) command. You must have the privileges of a superuser or a database owner to use this command. Connect to `psql` as a superuser for a database and run the following command:
3939

40-
```
40+
```sql
4141
CREATE EXTENSION pg_tde;
4242
```
4343

@@ -73,7 +73,7 @@ You must do these steps for every database where you have created the extension.
7373
'/path_to/client_cert.pem',
7474
'/path_to/client_key.pem',
7575
'/path_to/server_certificate.pem'
76-
);
76+
);
7777
```
7878

7979
where:
@@ -95,7 +95,7 @@ You must do these steps for every database where you have created the extension.
9595
'/tmp/client_cert_jane_doe.pem',
9696
'/tmp/client_key_jane_doe.pem',
9797
'/tmp/server_certificate.pem'
98-
);
98+
);
9999
```
100100
101101
=== "With HashiCorp Vault"
@@ -109,7 +109,7 @@ You must do these steps for every database where you have created the extension.
109109
'mount',
110110
'secret_token_path',
111111
'ca_path'
112-
);
112+
);
113113
```
114114
115115
where:
@@ -121,15 +121,15 @@ You must do these steps for every database where you have created the extension.
121121
122122
<i warning>:material-information: Warning:</i> This example is for testing purposes only:
123123
124-
```sql
125-
SELECT pg_tde_add_database_key_provider_file_vault_v2(
124+
```sql
125+
SELECT pg_tde_add_database_key_provider_file_vault_v2(
126126
'my-vault',
127127
'http://vault.vault.svc.cluster.local:8200',
128128
'secret/data',
129129
'hvs.zPuyktykA...example...ewUEnIRVaKoBzs2',
130130
NULL
131-
);
132-
```
131+
);
132+
```
133133
134134
=== "With a keyring file (not recommended)"
135135
@@ -139,25 +139,25 @@ You must do these steps for every database where you have created the extension.
139139
SELECT pg_tde_add_database_key_provider_file(
140140
'provider-name',
141141
'/path/to/the/keyring/data.file'
142-
);
142+
);
143143
```
144144
145145
<i warning>:material-information: Warning:</i> This example is for testing purposes only:
146146
147-
```sql
148-
SELECT pg_tde_add_database_key_provider_file(
147+
```sql
148+
SELECT pg_tde_add_database_key_provider_file(
149149
'file-keyring',
150150
'/tmp/pg_tde_test_local_keyring.per'
151-
);
152-
```
151+
);
152+
```
153153
154154
2. Create a key
155-
```sql
156155
156+
```sql
157157
SELECT pg_tde_create_key_using_database_key_provider(
158158
'name-of-the-key',
159159
'provider-name'
160-
);
160+
);
161161
```
162162
163163
where:
@@ -171,19 +171,19 @@ You must do these steps for every database where you have created the extension.
171171
SELECT pg_tde_create_key_using_database_key_provider(
172172
'test-db-master-key',
173173
'file-vault'
174-
);
174+
);
175175
```
176176
177177
!!! note
178178
The key is auto-generated.
179179
180180
3. Use the key as principal key
181-
```sql
182181
182+
```sql
183183
SELECT pg_tde_set_key_using_database_key_provider(
184184
'name-of-the-key',
185185
'provider-name'
186-
);
186+
);
187187
```
188188
189189
where:
@@ -197,5 +197,5 @@ You must do these steps for every database where you have created the extension.
197197
SELECT pg_tde_set_key_using_database_key_provider(
198198
'test-db-master-key',
199199
'file-vault'
200-
);
200+
);
201201
```

contrib/pg_tde/documentation/docs/how-to/uninstall.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ This can happen if WAL encryption was not properly disabled before removing `pg_
124124

125125
You might see this when restarting the PostgreSQL cluster:
126126

127-
```sh
127+
```
128128
2025-04-01 17:12:50.607 CEST [496385] PANIC: could not locate a valid checkpoint record at 0/17B2580
129129
```
130130

contrib/pg_tde/documentation/docs/replication.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ sudo systemctl start postgresql
8282
* On primary:
8383

8484
```sql
85-
SELECT client_addr, state
86-
FROM pg_stat_replication;
85+
SELECT client_addr, state FROM pg_stat_replication;
8786
```
8887

8988
* On standby:

0 commit comments

Comments
 (0)