Add support for per env postgresql configs.
When these configs are present, conf files from pgconfigs are skipped.
This commit is contained in:
parent
72aae13e86
commit
14e4b865ca
2 changed files with 18 additions and 3 deletions
|
@ -24,6 +24,13 @@ pg${PGV}.conf
|
|||
pg${PGV}-<Cluster #>.conf
|
||||
```
|
||||
|
||||
PostgreSQL local configs per are named similarly but starts with (.) dot and stored in worktree folder. These will superseed `${GIT_DIR}/pgconfigs/`:
|
||||
|
||||
```
|
||||
.pg${PGV}.conf
|
||||
.pg${PGV}-<Cluster #>.conf
|
||||
```
|
||||
|
||||
### Advance setting for pg-env
|
||||
|
||||
| Config | Defaults | Description |
|
||||
|
|
14
pg-env
14
pg-env
|
@ -314,12 +314,20 @@ pexec(){
|
|||
setupdb(){
|
||||
if [ -z "$1" ]; then
|
||||
initdb --data-checksums --username=${USER}
|
||||
echo "include = '${GIT_DIR}/pgconfigs/pg${PGV}.conf'" >> ${PGDATA}/postgresql.conf
|
||||
if [ -f "$(pwd)/.pg${PGV}.conf" ]; then
|
||||
echo "include = '$(pwd)/.pg${PGV}.conf'" >> ${PGDATA}/postgresql.conf
|
||||
else
|
||||
echo "include = '${GIT_DIR}/pgconfigs/pg${PGV}.conf'" >> ${PGDATA}/postgresql.conf
|
||||
fi
|
||||
else
|
||||
for NodeN in $@
|
||||
do
|
||||
initdb --data-checksums --username=${USER} -D ${PGDATA}-${NodeN}
|
||||
echo "include = '${GIT_DIR}/pgconfigs/pg${PGV}-${NodeN}.conf'" >> ${PGDATA}-${NodeN}/postgresql.conf
|
||||
initdb --data-checksums --username=${USER} -D ${PGDATA}-${NodeN}
|
||||
if [ -f "$(pwd)/.pg${PGV}-${NodeN}.conf" ]; then
|
||||
echo "include = '$(pwd)/.pg${PGV}-${NodeN}.conf'" >> ${PGDATA}-${NodeN}/postgresql.conf
|
||||
else
|
||||
echo "include = '${GIT_DIR}/pgconfigs/pg${PGV}-${NodeN}.conf'" >> ${PGDATA}-${NodeN}/postgresql.conf
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue