Skip to content

[bitnami/postgresql-repmgr] Running custom script on primary database when container starting #70606

Closed as not planned
@ThomasRasmussen

Description

@ThomasRasmussen

Name and Version

bitnami/postgresql-repmgr:16.3.0

What is the problem this feature will solve?

Whenever the database container is started, I want to have some sanity check preformed on the database and possibly fix something in the database if need be.
As far as I can see there is only the docker-entrypoint.initdb.d directory but this is only sourced the first time the database is initialized and then a file will prevent scripts here ever being run again.

One usecase is infact related to upgrading the container from 16.1.0 to 16.3.0 where a collation version needs to be refreshed. I wanted to dump a script that will detect if a collation refresh is needed and then perform the necessary actions. But I cannot see any way of implementing this in the current image.

What is the feature you are proposing to solve the problem?

Having a change in the startup scripts that will always run the scripts in fx. /docker-entrypoint.d/*.{sh,sql} - something like the way it is done with /docker-entrypoint-initdb.d/ but without the limit on only running on initialization of database.

What alternatives have you considered?

  • manually hacking the startup scripts to implement this
  • Having an external app running this (requires the app to have access to db as postgres user)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions