Run init scripts after database creation

Open
#296 13 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
postgresql
Domain
databases, devops

Research direction

Start by reading the scripts in the init directory and trace how the container creates the database from POSTGRESQL_DATABASE. Define the completion check as init scripts running against that newly created database, with the requested schema, users, and permissions available there.

Written by the indexing model from the issue text.

Description

Hi,

I'd like to add a schema setup script to the init directory so that basic users, permissions etc are always available in the database. The init scripts fail as the database doesn't exist yet. (only the default postgres database exists at init time). The schema setup script would read the new database name from POSTGRESQL_DATABASE and run the schema setup in that database.

Dominant language
PLpgSQL
Stars
178
Forks
220
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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.

More from sclorg/postgresql-container

All issues in sclorg/postgresql-container

Similar issues

More Databases issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.