Skip to content

Commit

Permalink
Add PostgreSQL Extensions documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mkfdoherty committed May 3, 2024
1 parent 63dd27c commit 3e9b8d4
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
10 changes: 10 additions & 0 deletions docs/application-developers/usage_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,16 @@ When you want to delete a `Restore`, run:
kubectl delete restore <restore-name>
```

## Install/Uninstall PostgreSQL Extensions

PostgreSQL is designed to be easily extensible. For this reason, extensions loaded into the database can function just like features that are built in. Application developers can enable extensions by adding the desired extensions to the extensions field as a list. Likewise, extensions can be uninstalled by removing them from the extensions list. Extensions can be installed on new instances as well as on running instances.

WARNING: Extensions cannot be removed if they have dependencies on other objects in the database. If you are using features of an extension in your database tables, the removal operation will not succeed. Users must remove these blocking dependencies for the extension to be cleanly removed from the database. The PostgreSQL operator will not forcibly remove extensions with dependencies to avoid unexpected data loss.

The extensions currently supported are: postgis, uuid-ossp, ltree, pgcrypto, pg_stat_statements, fuzzystrmatch, pg_trgm, hstore.

See [examples/postgresql-extensions-instance.yaml](examples/postgresql-extensions-instance.yaml) for an example manifest containing a list of desired extensions to be installed.

## Visualize the Logs of the PostgreSQL Instance

Application developers should be aware that all pods with the label field `app`
Expand Down
8 changes: 4 additions & 4 deletions docs/current_limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@

to force the deletion.

## PostgreSQL Extensions

- Status on extension state, required for informing user of unresolvable dependencies on extensions that block their removal.

## Service Bindings

- Custom parameters for configuring the permissions are not supported.
Expand All @@ -67,10 +71,6 @@
reason behind that is that the secrets, where the password and username are
stored, are limited to a single namespace (see [Kubernetes Secrets][k8s-secrets])

## PostgreSQL Extensions

- Extensions validation does implement extension installation.

## Logging

- OpenDashboards has the authentication disabled, this means that the dashboard
Expand Down
22 changes: 22 additions & 0 deletions examples/postgresql-extensions-instance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: postgresql.anynines.com/v1beta3
kind: Postgresql
metadata:
name: sample-pg-cluster
spec:
extensions:
- postgis
- uuid-ossp
- ltree
- pgcrypto
- pg_stat_statements
- fuzzystrmatch
- pg_trgm
- hstore
replicas: 3
volumeSize: 1Gi
version: 14
resources:
requests:
cpu: 100m
limits:
memory: 200Mi
3 changes: 3 additions & 0 deletions test/e2e/postgresql/postgresql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1321,6 +1321,7 @@ var _ = Describe("PostgreSQL Operator end-to-end tests", func() {
})

It("Provisions the PostgreSQL instance with one PostgreSQL extension", func() {
Skip("Skip MobilityDB related tests until we support arbitrary extensions")
extensions := []string{"mobilitydb"}

instance, err = dsi.New(
Expand Down Expand Up @@ -1404,6 +1405,7 @@ var _ = Describe("PostgreSQL Operator end-to-end tests", func() {
})

It("Adds one PostgreSQL extension on update", func() {
Skip("Skip MobilityDB related tests until we support arbitrary extensions")
instance, err = dsi.New(
dataservice,
testingNamespace,
Expand Down Expand Up @@ -1547,6 +1549,7 @@ var _ = Describe("PostgreSQL Operator end-to-end tests", func() {
})

It("Removes all PostgreSQL extensions on update", func() {
Skip("Skip MobilityDB related tests until we support arbitrary extensions")
extensions := []string{"mobilitydb"}
instance, err = dsi.New(
dataservice,
Expand Down

0 comments on commit 3e9b8d4

Please sign in to comment.