citusdata / citusdata/pg_cron

Read `cron.database_name` from environment variables (`$PGDATABASE`)

Open
#314 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
3.9k
Forks
260
Avg merge
5d 5h
Merged PRs (30d)
1

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.