@@ -28,7 +28,9 @@ every session start for restricted users. This can be accomplished by configurin
2828For example, to automatically load the ` pg_diffix ` extension for all users connecting to a database,
2929you can execute the following command:
3030
31- ` ALTER DATABASE db_name SET session_preload_libraries TO 'pg_diffix'; `
31+ ```
32+ ALTER DATABASE db_name SET session_preload_libraries TO 'pg_diffix';
33+ ```
3234
3335Once loaded, the extension logs information to ` /var/log/postgresql/postgresql-13-main.log ` or equivalent.
3436
@@ -42,7 +44,9 @@ You might also need to remove the extension from the list of preloaded libraries
4244
4345For example, to reset the list of preloaded libraries for a database, you can execute the following command:
4446
45- ` ALTER DATABASE db_name SET session_preload_libraries TO DEFAULT; `
47+ ```
48+ ALTER DATABASE db_name SET session_preload_libraries TO DEFAULT;
49+ ```
4650
4751## Testing the extension
4852
@@ -61,7 +65,10 @@ or if available, just make your usual PostgreSQL user a `SUPERUSER`.
6165
6266Or you can use the [ PGXN Extension Build and Test Tools] ( https://github.com/pgxn/docker-pgxn-tools ) Docker image:
6367
64- ` docker run -it --rm --mount "type=bind,src=$(pwd),dst=/repo" pgxn/pgxn-tools sh -c 'cd /repo && apt update && apt install -y jq && pg-start 13 && pg-build-test' ` .
68+ ```
69+ docker run -it --rm --mount "type=bind,src=$(pwd),dst=/repo" pgxn/pgxn-tools sh -c \
70+ 'cd /repo && apt update && apt install -y jq && pg-start 13 && pg-build-test'
71+ ```
6572
6673## Docker images
6774
@@ -76,15 +83,21 @@ The example below shows how to build the image and run a minimally configured co
7683
7784Build the image:
7885
79- ` make image `
86+ ```
87+ make image
88+ ```
8089
8190Run the container in foreground and expose in port 10432:
8291
83- ` docker run --rm --name pg_diffix -e POSTGRES_PASSWORD=postgres -p 10432:5432 pg_diffix `
92+ ```
93+ docker run --rm --name pg_diffix -e POSTGRES_PASSWORD=postgres -p 10432:5432 pg_diffix
94+ ```
8495
8596From another shell you can connect to the container via ` psql ` :
8697
87- ` psql -h localhost -p 10432 -d postgres -U postgres `
98+ ```
99+ psql -h localhost -p 10432 -d postgres -U postgres
100+ ```
88101
89102For more advanced usage see the [ official image reference] ( https://hub.docker.com/_/postgres ) .
90103
@@ -102,16 +115,25 @@ Three users are created, all of them with password `demo`:
102115
103116Build the image:
104117
105- ` make demo-image `
118+ ```
119+ make demo-image
120+ ```
106121
107122Run the container in foreground and expose in port 10432:
108123
109- ` docker run --rm --name pg_diffix_demo -e POSTGRES_PASSWORD=postgres -e BANKING_PASSWORD=demo -p 10432:5432 pg_diffix_demo `
124+ ```
125+ docker run --rm --name pg_diffix_demo -e POSTGRES_PASSWORD=postgres -e BANKING_PASSWORD=demo -p 10432:5432 pg_diffix_demo
126+ ```
110127
111128Connect to the banking database (from another shell) for anonymized access:
112129
113- ` psql -h localhost -p 10432 -d banking -U trusted_user `
130+ ```
131+ psql -h localhost -p 10432 -d banking -U trusted_user
132+ ```
114133
115134To keep the container running you can start it in detached mode and with a restart policy:
116135
117- ` docker run -d --name pg_diffix_demo --restart unless-stopped -e POSTGRES_PASSWORD=postgres -e BANKING_PASSWORD=demo -p 10432:5432 pg_diffix_demo `
136+ ```
137+ docker run -d --name pg_diffix_demo --restart unless-stopped \
138+ -e POSTGRES_PASSWORD=postgres -e BANKING_PASSWORD=demo -p 10432:5432 pg_diffix_demo
139+ ```
0 commit comments