Delete a PostgreSQL service

Delete non protected PostgreSQL instance

If you do not need your PostgreSQL service anymore, you can delete it in the same way as you would with any other object in your cluster:

$ oc delete vshnpostgresqls.vshn.appcat.vshn.io my-postgres-example
Non-reversible operation

If you delete the VSHNPostgreSQL object from the cluster, it will be deleted together with all of its data!

Delete protected PostgreSQL instance

A PostgreSQL instance that is protected from deletion cannot be deleted right away. First disable deletion protection then delete the instance.

  1. Disable deletion protection:

    $ oc edit vshnpostgresqls.vshn.appcat.vshn.io my-postgres-example
    apiVersion: vshn.appcat.vshn.io/v1
    kind: VSHNPostgreSQL
    metadata:
      name: pgsql-app1-prod
      namespace: prod-app
    spec:
      parameters:
        backup:
          deletionProtection: false (1)
      writeConnectionSecretToRef:
        name: postgres-creds
    1 Make sure the parameter is set to false
  2. Delete the instance

    $ oc delete vshnpostgresqls.vshn.appcat.vshn.io my-postgres-example
    Non-reversible operation

    If you delete the VSHNPostgreSQL object from the cluster, it will be deleted together with all of its data!