Skip to content

Allow init script to fail and prevent DB startup (for testing) #1113

Closed
@nyurik

Description

@nyurik

In an automated testing environment, it is often needed to pre-load a db with some data. This is usually done by a script, e.g. /docker-entrypoint-initdb.d/10_init.sh

The script would then run psql -e -P pager=off -v ON_ERROR_STOP=1 -f "some_sql_file.sql" - but the problem is that there is no documented way to prevent database from starting up in case an error occurs, even if the script has set -euo pipefail at the beginning.

Is there an established way to do this? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions