zalando / zalando/postgres-operator

PostgreSQL extensions are installed in a random order

Open
#2,198 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
Go
Stars
5.2k
Forks
1.1k
Avg merge
2d 16h
Merged PRs (30d)
3

Description

  • registry.opensource.zalan.do/acid/postgres-operator:v1.8.2
  • AWS EKS
  • Production: no
  • Feature request

There are certain extensions that have other extensions as dependencies, e.g. I want to install postgis, postgis_raster and postgis_topology extensions. The postgis_topology requires postgis but it is not always installed first. Yes, sometimes it seems to be happening in a correct way, but the whole process feels completely random and may take a lot of attempts and time.

postgresql cluster crd:

  preparedDatabases:
    test:
      extensions:
        postgis: public
        postgis_raster: public
        postgis_topology: topology

postgres-operator log messages:

time="2023-01-31T14:45:26Z" level=info msg="creating extension \"postgis_topology\" schema \"topology\"" cluster-name=default/test pkg=cluster worker=0
time="2023-01-31T14:45:26Z" level=error msg="could not sync prepared databases: could not execute create extension: pq: required extension \"postgis\" is not installed" cluster-name=default/test pkg=cluster worker=0

In order to make it work all the time from the first try there should be a strict order of installation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing preparedDatabases extension synchronization from the PostgreSQL cluster CRD to the logged create-extension operation. Use the postgis, postgis_raster, and postgis_topology example to check how dependencies are represented and ordered; done means required extensions install deterministically on the first attempt.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go, kubernetes, postgresql
Domain
databases, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.