Skip to content

Commit e68931c

Browse files
docs: Add pgaudit extensions
Co-authored-by: John Long <john.long@enterprisedb.com>
1 parent fca06cf commit e68931c

File tree

3 files changed

+43
-14
lines changed

3 files changed

+43
-14
lines changed

.spellcheck.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ matrix:
2424
close: '(?P=open)'
2525
- open: '(?P<open><!--)'
2626
close: '(?P<close>-->)'
27+
- pyspelling.filters.url:

.wordlist-en-custom.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ jobCount
484484
jq
485485
json
486486
jsonpath
487+
kbytes
487488
kms
488489
kube
489490
kubebuilder
@@ -679,6 +680,7 @@ secretName
679680
secretkeyselector
680681
securego
681682
securityContext
683+
seg
682684
serverCASecret
683685
serverName
684686
serverTLSSecret

docs/src/postgresql_conf.md

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ As anticipated in the previous section, Cloud Native PostgreSQL automatically
182182
manages the content in `shared_preload_libraries` for some well-known and
183183
supported extensions. The current list includes:
184184

185+
- `auto_explain`
185186
- `pg_stat_statements`
186187
- `pgaudit`
187188

@@ -201,6 +202,30 @@ SELECT datname FROM pg_database WHERE datallowconn
201202
!!! Note
202203
The above query also includes template databases like `template1`.
203204

205+
#### Enabling `auto_explain`
206+
207+
The [`auto_explain`](https://www.postgresql.org/docs/current/auto-explain.html)
208+
extension provides a means for logging execution plans of slow statements
209+
automatically, without having to manually run `EXPLAIN` (helpful for tracking
210+
down un-optimized queries).
211+
212+
You can enable `auto_explain` by adding to the configuration a parameter
213+
that starts with `auto_explain.` as in the following example excerpt (which
214+
automatically logs execution plans of queries that take longer than 10 seconds
215+
to complete):
216+
217+
```yaml
218+
# ...
219+
postgresql:
220+
parameters:
221+
auto_explain.log_min_duration: "10s"
222+
# ...
223+
```
224+
225+
!!! Note
226+
Enabling auto_explain can lead to performance issues. Please refer to [`the auto explain documentation`](https://www.postgresql.org/docs/current/auto-explain.html)
227+
228+
204229
#### Enabling `pg_stat_statements`
205230

206231
The [`pg_stat_statements`](https://www.postgresql.org/docs/current/pgstatstatements.html)
@@ -224,24 +249,25 @@ As explained previously, the operator will automatically add
224249
NOT EXISTS pg_stat_statements` on each database, enabling you to run queries
225250
against the `pg_stat_statements` view.
226251

227-
#### Enabling `auto_explain`
252+
#### Enabling `pgaudit`
228253

229-
The [`auto_explain`](https://www.postgresql.org/docs/current/auto-explain.html)
230-
extension provides a means for logging execution plans of slow statements
231-
automatically, without having to manually run `EXPLAIN` (helpful for tracking
232-
down un-optimized queries).
254+
The `pgaudit` extension provides detailed session and/or object audit logging via the standard PostgreSQL logging facility.
233255

234-
You can enable `auto_explain` by adding to the configuration a parameter
235-
that starts with `auto_explain.` as in the following example excerpt (which
236-
automatically logs execution plans of queries that take longer than 10 seconds
237-
to complete):
256+
Cloud Native PostgreSQL has transparent and native support for
257+
[PGAudit](https://www.pgaudit.org/) on PostgreSQL clusters. For further information, please refer to the ["PGAudit" logs section.](logging.md#pgaudit-logs)
258+
259+
You can enable `pgaudit` by adding to the configuration a parameter
260+
that starts with `pgaudit.` as in the following example excerpt:
238261

239262
```yaml
240-
# ...
241-
postgresql:
242-
parameters:
243-
auto_explain.log_min_duration: "10s"
244-
# ...
263+
#
264+
postgresql:
265+
parameters:
266+
pgaudit.log: "all, -misc"
267+
pgaudit.log_catalog: "off"
268+
pgaudit.log_parameter: "on"
269+
pgaudit.log_relation: "on"
270+
#
245271
```
246272

247273
## The `pg_hba` section

0 commit comments

Comments
 (0)