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

Read cron.database_name from environment variables ($PGDATABASE) #314

Open
sepsol opened this issue Mar 1, 2024 · 0 comments
Open

Read cron.database_name from environment variables ($PGDATABASE) #314

sepsol opened this issue Mar 1, 2024 · 0 comments

Comments

@sepsol
Copy link

sepsol commented Mar 1, 2024

I am bind-mounting a configs directory from my host machine that is tracked by git, to the docker container running postgres. The reason for using a volume is to have the config changes be applied immediately to the database. The only thing stopping me from completing this setup is that I have to hardcode my database name in the configs which I don't like since this repository is tracked by git and is a template repository that I plan to use for all my other microservices.

Originally, I was copying configs during db initialization and used envsubst command to replace ${PGDATABASE} in cron.database_name = '${PGDATABASE}' with my actual database name. But this wouldn't work with volumes. Therefore, I thought to reach out here and ask that pg_cron respects standard postgres environment variables in future updates. For now, I have to either live without volumes or hardcode my db name to my config files which is not ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant