postgresql-container icon indicating copy to clipboard operation
postgresql-container copied to clipboard

add initialization example script

Open aushacker opened this issue 3 years ago • 6 comments

A simple example showing how to configure a database with some test data.

When using ephemeral storage the database name specified by POSTGRESQL_DATABASE must be different from that created in the user provided script, otherwise the container will crash loop. This is due to the default scripts hard failing when trying to create a database that the user supplied init script has already created.

See issue #296 for narrative (known problem).

aushacker avatar Dec 13 '22 06:12 aushacker

[test-all]

phracek avatar Jan 02 '23 09:01 phracek

@phracek Have had a look through the available tests, none of them seem to match the required procedure.

What is needed to test would be something like:

  1. Build base image
  2. Create a new image, layering in postgresql-init/initialize.sh
  3. Spin up the image from 2 in podman/docker
  4. Use a postgresql client to connect and query the quotes database

How does that fit in with the current testing procedure?

aushacker avatar Jan 10 '23 22:01 aushacker

I do not see any problem with proposed example

fila43 avatar Jan 24 '23 14:01 fila43

[test-all]

fila43 avatar Mar 30 '23 13:03 fila43

@aushacker Thank you for this pull request. Please do following steps:

  • rebase it agains the master
  • call make clean-versions
  • call make generate-all which is mandatory, because of distgen check is failing. It means that generated changes are different then we expect it.

phracek avatar Aug 28 '23 08:08 phracek

Pull Request validation

Failed

🔴 Review - Missing review from a member (1 required)

Success

🟢 CI - All checks have passed

github-actions[bot] avatar Nov 07 '24 11:11 github-actions[bot]