Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow docker entrypoint to execute psql command in shell script if PGHOST is set #319

Closed
wants to merge 1 commit into from

Conversation

mishaschwartz
Copy link

@mishaschwartz mishaschwartz commented Nov 18, 2024

This resolves #318 by temporarily making the psql command an alias for docker_process_sql and exporting it so that it can be used in executed shell scripts.

This change is only applied for the duration of the docker_process_init_files function so it should not affect any other calls to psql in the container.

To test this:

docker run --rm -e 'POSTGRES_USER=username' -e 'PGUSER=username' -e 'POSTGRES_PASSWORD=password' -e 'POSTGRES_DB=postgis' -e 'PGDATABASE=postgis' -e 'PGHOST=localhost' ghcr.io/stac-utils/pgstac:v0.9.1 postgres

The above command should run with no failures

@mishaschwartz
Copy link
Author

See #318

@mishaschwartz mishaschwartz deleted the fix-psql-bug branch December 9, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant