postgresql stop on error and not import

Created on 24 Feb 2016  路  2Comments  路  Source: docker-library/postgres

good night, with the upgrade version https://github.com/docker-library/postgres/commit/916a840510b481e7d3f0f74fa04fde3edfdfbd04

I can no longer import my data, they stop at the first error.

How would I do to disable this option that was added at the last commit?
聽 ON_ERROR_STOP = 1

thank you

Most helpful comment

Most users wanted to error when there was a problem importing the sql. To work around it, just make a simple script to go with it:

# /docker-entrypoint-initdb.d/myscript.sh
#!/bin/bash
set -e

psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "my-custom-sql"

As long as your sql file does not end with ".sql", you can import it however you want.

All 2 comments

Most users wanted to error when there was a problem importing the sql. To work around it, just make a simple script to go with it:

# /docker-entrypoint-initdb.d/myscript.sh
#!/bin/bash
set -e

psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "my-custom-sql"

As long as your sql file does not end with ".sql", you can import it however you want.

About ON_ERROR_STOP, I understand, thanks for the explanation.

About the script, thanks also worked perfectly.

Thank you for the quick response.

Finally congratulations to you and the team. This project is excellent.

Was this page helpful?
0 / 5 - 0 ratings